Post data to API.
336948
def post(self, command, data=None):
        """"""
        now = calendar.timegm(datetime.datetime.now().timetuple())
        if now > self.expiration:
            auth = self.__open("/oauth/token", data=self.oauth)
            self.__sethead(auth['access_token'])
        return self.__open("%s%s" % (self.api, command),
                           headers=self.head, data=data)
277845
def post(self, data):
        
        if not self.url:
            raise Error('URL for incoming webhook is undefined')

        return requests.post(self.url, data=json.dumps(data),
                             timeout=self.timeout, proxies=self.proxies)
593989
def post(self, url, data=None, params=None):
        
        return self.request("post", url, data, params)
1160406
async def _post(self, zone_id: int = None, json: dict = None) -> dict:
        """"""
        return await self._request(
            'post', 'zone/{0}/properties'.format(zone_id), json=json)
500303
def post(self, url, data, headers=None):
        
        return self._request('POST', url, data, headers=headers)
747507
def api_post(message, url, name, http_data=None, auth=None):
    
    try:
        import requests
    except ImportError:
        print('requests is required to do api post.', file=sys.stderr)
        sys.exit(1)

    data = {name : message}
    if http_data:
        for var in http_data:
            key, value = var.split('=')
            data[key] = value

    response = requests.post(
        url,
        data=data,
        auth=auth
    )

    if response.status_code != 200:
        raise RuntimeError('Unable to post data')
408980
def _post(self, url, data={}, **kwargs):
        """"""
        if 'files' in kwargs:
            req = self._session.post(self._api_prefix + url, auth=self._session.auth, data=data, **kwargs)
            return self._action(req)

        req = self._session.post(self._api_prefix + url, data=data, **kwargs)
        return self._action(req)
729770
def post(self, receiver_id=None):
        """"""
        try:
            user_id = request.oauth.access_token.user_id
        except AttributeError:
            user_id = current_user.get_id()

        event = Event.create(
            receiver_id=receiver_id,
            user_id=user_id
        )
        db.session.add(event)
        db.session.commit()

        # db.session.begin(subtransactions=True)
        event.process()
        db.session.commit()
        return make_response(event)
1345728
def post(self, request, *args, **kwargs):
        """"""
        kwargs['pk'] = request.user.id
        self.kwargs['pk'] = request.user.id
        return super().post(request, *args, **kwargs)
89314
def post_json(self, uri, data, **kwargs):
        
        encoded_data = json.dumps(data)
        kwargs.setdefault("headers", {}).update({
            "Content-Type": "application/json",  # tell server we are sending json
        })
        return self.post(uri, data=encoded_data, **kwargs)
489331
def post(self, url, body=None):
        """"""
        response = self.http_request(url, 'POST', body or self, {'Content-Type': 'application/xml; charset=utf-8'})
        if response.status not in (200, 201, 204):
            self.raise_http_error(response)

        self._url = response.getheader('Location')

        if response.status in (200, 201):
            response_xml = response.read()
            logging.getLogger('recurly.http.response').debug(response_xml)
            self.update_from_element(ElementTree.fromstring(response_xml))
858217
def post(self, request):
        """"""
        serializer = AuthTokenSerializer(data=request.data)

        if serializer.is_valid():
            token, _ = ExpiringToken.objects.get_or_create(
                user=serializer.validated_data['user']
            )

            if token.expired():
                # If the token is expired, generate a new one.
                token.delete()
                token = ExpiringToken.objects.create(
                    user=serializer.validated_data['user']
                )

            data = {'token': token.key}
            return Response(data)

        return Response(serializer.errors, status=HTTP_400_BAD_REQUEST)
1029935
async def post(self, request, resource=None, **kwargs):
        """"""
        resource = await self.load(request, resource=resource, **kwargs)
        resource = await self.save(request, resource=resource, **kwargs)
        return self.to_simple(request, resource, many=isinstance(resource, list), **kwargs)
348502
public JsonResponse apiPost(ApiParams data, ApiFileParams fileParams) throws IOException {
        return httpRequestJson(HttpRequestMethod.POST, data, fileParams);
    }
958642
def post(self, uri, body=None, **kwargs):
        """"""
        return self.fetch('post', uri, kwargs.pop("query", {}), body, **kwargs)
1220469
def call_api(self, table, column, value, **kwargs):
        """"""
        try:
            output_format = kwargs.pop('output_format')
        except KeyError:
            output_format = self.output_format
        url_list = [self.base_url, table, column,
                    quote(value), 'rows']
        rows_count = self._number_of_rows(**kwargs)
        url_list.append(rows_count)
        url_string = '/'.join(url_list)
        xml_data = urlopen(url_string).read()
        data = self._format_data(output_format, xml_data)
        return data
433277
def _post_request(self, url, data=None, json=None, **kwargs):
        
        '''  '''
        
    # construct request kwargs
        request_kwargs = {
            'method': 'POST',
            'url': url,
            'data': data,
            'json': json
        }
        for key, value in kwargs.items():
            request_kwargs[key] = value

    # send request and handle response
        return self._request(**request_kwargs)