Make the POST request.
488177
def _post(self, data, file_to_upload=None):
        
        # pylint: disable=E1101
        params = {"JSONRPC": simplejson.dumps(data)}
        req = None
        if file_to_upload:
            req = http_core.HttpRequest(self.write_url)
            req.method = 'POST'
            req.add_body_part("JSONRPC", simplejson.dumps(data), 'text/plain')
            upload = file(file_to_upload, "rb")
            req.add_body_part("filePath", upload, 'application/octet-stream')
            req.end_of_parts()
            content_type = "multipart/form-data; boundary=%s" % \
                http_core.MIME_BOUNDARY
            req.headers['Content-Type'] = content_type
            req.headers['User-Agent'] = config.USER_AGENT

            req = http_core.ProxiedHttpClient().request(req)
        else:
            msg = urllib.urlencode({'json': params['JSONRPC']})
            req = urllib2.urlopen(self.write_url, msg)

        if req:
            result = simplejson.loads(req.read())
            if 'error' in result and result['error']:
                exceptions.BrightcoveError.raise_exception(
                    result['error'])
            return result['result']
287758
def _make_request(self, method, url, post_data=None, body=None):
        
        if not self.connection:
            self._connect()
        try:
            self.connection.close()
        except:
            pass
        self.connection.connect()
        headers = {}
        if self.auth_header:
            headers["Authorization"] = self.auth_header
        self.connection.request(method, url, body, headers)
        resp = self.connection.getresponse()
        return resp
1158018
def users_request_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/users/request_create.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
1372388
def post(self, request, *args, **kwargs):
        
        return self.approve(request, *args, **kwargs)
293332
def post(self, request, *args, **kwargs):
        """"""
        try:
            kwargs = self.load_object(kwargs)
        except Exception as e:
            return self.render_te_response({
                'title': str(e),
            })

        if not self.has_permission(request):
            return self.render_te_response({
                'title': 'No access',
            })
        return self.render_te_response(self.handle_dialog(*args, **kwargs))
1256392
async def post(self, request):
        """"""
        form = await self.get_form(request)
        if not form.validate():
            raise muffin.HTTPBadRequest(
                text=json.dumps(form.errors), content_type='application/json')
        await self.save_form(form, request)
        raise muffin.HTTPFound(self.url)
1306490
def post(param_map, url=URL):
    """"""
    prepped_request = _prep_post(url=url, **param_map)
    return cgi.send(prepped_request)
440675
def post(self, url, post_params=None):
        
        post_params['token'] = self.token
        params = urlencode(post_params)
        logger.debug('Making POST request to %s with body %s', url, params)
        return requests.post(url, data=params)
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()
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)
1018789
def post(self, resource, data=None, json=None):
        
        return self.do(resource, 'POST', data=data, json=json)
508198
def _request(self, data):
        """"""
        return requests.post(self.endpoint, data=data.encode("ascii")).content
176366
def create(cls, data=None, api_key=None, endpoint=None, add_headers=None,
               **kwargs):
        """"""
        cls.validate(data)
        inst = cls(api_key=api_key)
        endpoint = ''
        return inst.request('POST',
                            endpoint=endpoint,
                            data=data,
                            query_params=kwargs,
                            add_headers=add_headers,
                            )
1247431
def make_request(self, model, action, url_params={}, post_data=None):
        '''
        
        '''
        url = self._create_url(model, **url_params)
        headers = self._headers(action)

        try:
            response = requests.request(action, url, headers=headers, data=post_data)
        except Exception as e:
            raise APIError("There was an error communicating with Union: %s" % e)

        if not self._is_valid(response):
            raise ValidationError("The Union response returned an error: %s" % response.content)

        return self._parse_response(response)
823244
protected function _makeRequest()
    {
        # Check for cURL. If it isn't loaded, fall back to fopen()
        if(function_exists('curl_init'))
            $this->_rawResponse = $this->_makeCurlRequest($this->_url);
        else
            $this->_rawResponse = $this->_makeFOpenRequest($this->_url);
    }
822479
def post(self, *args, **kwargs):
        """"""
        if self.upload_allowed():
            form = self.get_upload_form()
            result = {}
            if form.is_valid():
                storage = self.get_storage()
                result['is_valid'] = True
                info = form.stash(storage, self.request.path)
                result.update(info)
            else:
                result.update({
                    'is_valid': False,
                    'errors': form.errors,
                })
            return HttpResponse(json.dumps(result), content_type='application/json')
        else:
            return HttpResponseForbidden()
956299
def post(self, request, *args, **kwargs):
        
        response = self.create(request, *args, **kwargs)
        response.data = None
        return response