Used to make post calls to mattermost api
        :param request:
        :param data:
        :return:
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)
846595
def put(self, endpoint, json=None, params=None, **kwargs):
        
        json = kwargs['data'] if 'data' in kwargs else json
        return self._make_request('put', endpoint, data=json, params=params)
1290356
def post(self, url, data=None, files=None, headers=None, raw=False,
             send_as_json=True, content_type=None, **request_kwargs):
        

        return self._secure_request(
            url, 'post', data=data, files=files, headers=headers, raw=raw,
            send_as_json=send_as_json, content_type=content_type,
            **request_kwargs
        )
766839
def _req(self, endpoint, get_data=dict(), post_data=dict()):

        

        if get_data:
            request_parameter = "{}?{}".format(endpoint, urlencode(get_data))
        else:
            request_parameter = endpoint

        try:
            encdata = urlencode(post_data, True).encode('utf-8')
            response = self.oauth.request(request_parameter, data=encdata)
            self._checkResponseForErrors(response)
        except HTTPError as e:
            raise DeviantartError(e)

        return response
490336
def post(self, request, *args, **kwargs):
        
        return self.update_type(request, *args, **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)
866040
def request_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/requests.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
800983
def send_request(self, endpoint='ticker', coin_name=None, **kwargs):
        

        built_url = self._make_url(endpoint, coin_name)
        payload = dict(**kwargs)

        self._process_request(endpoint, built_url, payload)
50435
def post(self, request, **resources):
        
        if not self._meta.form:
            return None

        form = self._meta.form(request.data, **resources)
        if form.is_valid():
            return form.save()

        raise FormError(form)
1156202
def post(self, request, *args, **kwargs):
        
        self.object = self.get_object()
        self.get_context_data()
        inlines = self.construct_inlines()

        if all_valid(inlines):
            return self.forms_valid(inlines)
        return self.forms_invalid(inlines)
593989
def post(self, url, data=None, params=None):
        
        return self.request("post", url, data, params)
956299
def post(self, request, *args, **kwargs):
        
        response = self.create(request, *args, **kwargs)
        response.data = None
        return response
998716
def post(self, url, headers=None, body=None, kwargs=None):
        
        return self._request(
            method='post',
            url=url,
            headers=headers,
            body=body,
            kwargs=kwargs
        )
1240374
def _post(self, *args, **kwargs):
        
        if 'data' in kwargs:
            kwargs['data'] = json.dumps(kwargs['data'])
        response = requests.post(*args, **kwargs)
        response.raise_for_status()
627762
def post(self, request, *args, **kwargs):
        
        return self.unlock(request, *args, **kwargs)
1123399
def _api_call(self, endpoint, model=None, method=None, data=None, filters=None):
        
        if not self.token:
            raise RuntimeError("You do not have an API token!")

        if not method:
            raise ValueError("Method is required for API calls!")

        if model:
            endpoint = endpoint.format(**vars(model))
        url = '{}{}'.format(self.base_url, endpoint)
        headers = {
            'Authorization': "Bearer {}".format(self.token),
            'Content-Type': 'application/json',
            'User-Agent': self._user_agent,
        }

        if filters:
            headers['X-Filter'] = json.dumps(filters)

        body = None
        if data is not None:
            body = json.dumps(data)

        response = method(url, headers=headers, data=body)

        warning = response.headers.get('Warning', None)
        if warning:
            logger.warning('Received warning from server: {}'.format(warning))

        if 399 < response.status_code < 600:
            j = None
            error_msg = '{}: '.format(response.status_code)
            try:
                j = response.json()
                if 'errors' in j.keys():
                    for e in j['errors']:
                        error_msg += '{}; '.format(e['reason']) \
                                if 'reason' in e.keys() else ''
            except:
                pass
            raise ApiError(error_msg, status=response.status_code, json=j)

        if response.status_code != 204:
            j = response.json()
        else:
            j = None # handle no response body

        return j
1028972
def call(self, request):
        
        result = None
        try:
            if 'extAction' in request:  # DirectSubmit method
                tid = request['extTID']
                action = request['extAction']
                method = request['extMethod']
            else:
                tid = request['tid']
                action = request['action']
                method = request['method']
            element = self.configuration[action][method]
            if isinstance(element, tuple):  # class level function
                func = getattr(self.instances[element[0]], element[1])
            else:  # module level function
                func = element
            if func.exposed_kind == BASIC:  # basic method
                args = request['data'] or []
                result = func(*args)
            elif func.exposed_kind == LOAD:  # DirectLoad method
                args = request['data'] or []
                result = {'success': True, 'data': func(*args)}
            elif func.exposed_kind == SUBMIT:  # DirectSubmit method
                kwargs = request
                for k in ['extAction', 'extMethod', 'extType', 'extTID', 'extUpload']:
                    if k in kwargs:
                        del kwargs[k]
                try:
                    func(**kwargs)
                    result = {'success': True}
                except FormError as e:
                    result = e.extra
                    result['success'] = False
                    if e.errors:
                        result['errors'] = e.errors
            elif func.exposed_kind == STORE_READ:  # DirectStore read method
                kwargs = request['data'] or {}
                data = func(**kwargs)
                result = {'total': len(data), 'data': data}
            elif func.exposed_kind == STORE_CUD:  # DirectStore create-update-destroy methods
                kwargs = request['data'][0] or {}
                try:
                    result = {'success': True, 'data': func(**kwargs)}
                except Error:
                    result = {'success': False}
        except Exception as e:
            if self.debug:
                return {'type': 'exception', 'message': str(e), 'where': '%s.%s' % (action, method)}
        return {'type': 'rpc', 'tid': tid, 'action': action, 'method': method, 'result': result}