Creates a post request and return the response data
6897
def _create_delete_request(self, resource, billomat_id):
        
        assert (isinstance(resource, str))

        if isinstance(billomat_id, int):
            billomat_id = str(billomat_id)

        response = self.session.delete(
            url=self.api_url + resource + '/' + billomat_id,
        )

        return self._handle_response(response)
701806
def create(self, typ, data, return_response=False):
        
        res = self._request(typ, method='POST', data=data)
        if res.status_code != 201:
            try:
                data = res.json()
                self._throw(res, data)
            except ValueError as e:
                if not isinstance(e, InvalidRequestException):
                    self._throw(res, {})
                else:
                    raise

        loc = res.headers.get("location", None)
        if loc and loc.startswith('/'):
            return self._load(self._request(None, url=self.url_update(path=loc)))
        if return_response:
            return res.json()

        return self._load(self._request(None, url=loc))
583352
def post(self, resource, data=None, **kwargs):
        """"""
        headers = dict(kwargs.pop('headers', {}))
        headers.setdefault('Content-Type', 'application/json')
        data = json.dumps(data)
        return self.request('POST', resource, headers=headers,
                            data=data, **kwargs)
1158124
def post(self, url, data):
        '''  '''
        data.update({'key': self.APIKEY})
        req = r.post(url,
                     data    = json.dumps(data),
                     headers = self.headers,
                     auth    = self.auth)
        return self.process_request(req)
349093
def post(self, request, data=None):
        
        headers = {"Authorization": "Bearer " + self.token }
        logging.debug(json.dumps(data, indent=4))
        p = requests.post(self.url + request, headers=headers, data=json.dumps(data))
        return json.loads(p.text)
166968
def post(request):
    
    data = request.POST or json.loads(request.body)['body']
    key = data.get('key', None)
    val = data.get('val', None)
    res = Result()
    if key is not None and val is not None:
        obj, created = UserPref.objects.get_or_create(user=request.user)
        if created:
            obj.data = json.dumps(DefaultPrefs.copy())
            obj.save()
        try:
            val = json.loads(val)
        except (TypeError, ValueError):
            pass
        obj.setKey(key, val)
        obj.save()
        res.append(obj.json())

    return JsonResponse(res.asDict())
369485
def create_response(self, request, content, content_type):
        """"""

        return HttpResponse(content=content, content_type=content_type)
1232752
def _request_post(self, path, data=None, params=None, url=BASE_URL):
        """"""
        url = urljoin(url, path)

        headers = self._get_request_headers()

        response = requests.post(
            url, json=data, params=params, headers=headers,
            timeout=DEFAULT_TIMEOUT)
        response.raise_for_status()
        if response.status_code == 200:
            return response.json()
806632
def post(self, request, *args, **kwargs):
        
        serializer = EventSerializer(data=request.data)

        if not serializer.is_valid():
            return Response(
                {"accepted": False, "reason": serializer.errors}, status=400
            )

        data = serializer.validated_data

        event_type = {
            "ack": "ack",
            "nack": "nack",
            "delivery_report": "delivery_succeeded",
        }.get(data["event_type"])

        accepted, reason = process_event(
            data["user_message_id"], event_type, data["nack_reason"], data["timestamp"]
        )

        return Response(
            {"accepted": accepted, "reason": reason}, status=200 if accepted else 400
        )
81620
def post(self, url, data, headers={}):
        
        response = self._run_method('POST', url, data=data, headers=headers)
        return self._handle_response(url, response)
1296598
def post(self, endpoint, json=None, params=None, **kwargs):
        
        json = kwargs['data'] if 'data' in kwargs else json
        return self._make_request('post', endpoint, data=json, params=params)
262507
def post(self, endpoint, return_response=False, **kwargs):
        
        args = self.translate_kwargs(**kwargs)
        response = self.session.post(self.make_url(endpoint), **args)

        decoded_response = _decode_response(response)

        if return_response:
            return decoded_response, response
        return decoded_response
412184
def post(self, endpoint, params=None, version='1.1', json_encoded=False):
        """"""
        return self.request(endpoint, 'POST', params=params, version=version, json_encoded=json_encoded)
429925
def post(self, request, *args, **kwargs):
        
        self.object_list = None
        form = self.get_xeditable_form(self.get_xeditable_form_class())
        if form.is_valid():
            obj = self.get_update_object(form)
            if obj is None:
                data = json.dumps({
                    'status': 'error',
                    'message': "Object does not exist."
                })
                return HttpResponse(data, content_type="application/json", status=404)
            return self.update_object(form, obj)
        else:
            data = json.dumps({
                'status': 'error',
                'message': "Invalid request",
                'form_errors': form.errors,
            })
            return HttpResponse(data, content_type="application/json", status=400)
608642
function createResponse(xhr, request){
  
  // XHR header processing borrowed from jQuery
  var responseHeaders = {}, match;
  while ((match = headersRegex.exec(xhr.getAllResponseHeaders()))) {
		responseHeaders[match[1].toLowerCase()] = match[2];
	}
	
  return {
    statusCode: xhr.status,
    statusText: xhr.statusText,
    headers: responseHeaders,
    originalUrl: request.url,
    effectiveUrl: request.url,
    redirected: false,
    requestMethod: request.method,
    requestHeaders: request.headers,
    body: xhr.responseText,
    retries: 0,
    throttled: false
  };
}
920667
def post(self, request):
        ''''''
        serializer = CreateUserSerializer(data=request.data)
        serializer.is_valid(raise_exception=True)

        email = serializer.validated_data.get('email')
        try:
            user = User.objects.get(username=email)
        except User.DoesNotExist:
            user = User.objects.create_user(email, email=email)
        token, created = Token.objects.get_or_create(user=user)

        return Response(
            status=status.HTTP_201_CREATED, data={'token': token.key})
1308665
def post(url, data=None, json=None, **kwargs):
    """"""
    _set_content_type(kwargs)
    if _content_type_is_json(kwargs) and data is not None:
        data = dumps(data)
    _log_request('POST', url, kwargs, data)
    response = requests.post(url, data, json, **kwargs)
    _log_response(response)
    return response