Create a post or followup.

        :type  params: dict
        :param params: A dict of options to pass to the endpoint. Depends on
            the specific type of content being created.
        :returns: Python object containing returned data
322493
def content_create(self, params):
        
        r = self.request(
            method="content.create",
            data=params
        )
        return self._handle_error(
            r,
            "Could not create object {}.".format(repr(params))
        )
136495
def add_params(self, endpoint, params):
        
        assert endpoint.startswith(self.domain)
        return util.add_params(endpoint, params)
1127348
def view_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/views.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
983246
def add_custom(self, params):
        

        if isinstance(params, dict) is False:
            raise InvalidUsage("custom parameters must be of type `dict`")

        self._custom_params.update(params)
679897
async def create_post_request(self, method: str, params: Dict = None):
        
        if params is None:
            params = {}
        headers = {"Content-Type": "application/json"}
        payload = {
            "method": method,
            "params": [params],
            "id": next(self.idgen),
            "version": "1.0",
        }

        if self.debug > 1:
            _LOGGER.debug("> POST %s with body: %s", self.guide_endpoint, payload)

        async with aiohttp.ClientSession(headers=headers) as session:
            res = await session.post(self.guide_endpoint, json=payload, headers=headers)
            if self.debug > 1:
                _LOGGER.debug("Received %s: %s" % (res.status_code, res.text))
            if res.status != 200:
                raise SongpalException(
                    "Got a non-ok (status %s) response for %s" % (res.status, method),
                    error=await res.json()["error"],
                )

            res = await res.json()

        # TODO handle exceptions from POST? This used to raise SongpalException
        #      on requests.RequestException (Unable to get APIs).

        if "error" in res:
            raise SongpalException("Got an error for %s" % method, error=res["error"])

        if self.debug > 1:
            _LOGGER.debug("Got %s: %s", method, pf(res))

        return res
899000
def _extract_params(self):
        
        # Because in this endpoint we handle both GET
        # and POST request.
        query_dict = (self.request.POST if self.request.method == 'POST'
                      else self.request.GET)

        self.params['client_id'] = query_dict.get('client_id', '')
        self.params['redirect_uri'] = query_dict.get('redirect_uri', '')
        self.params['response_type'] = query_dict.get('response_type', '')
        self.params['scope'] = query_dict.get('scope', '').split()
        self.params['state'] = query_dict.get('state', '')
        self.params['nonce'] = query_dict.get('nonce', '')

        self.params['prompt'] = self._allowed_prompt_params.intersection(
            set(query_dict.get('prompt', '').split()))

        self.params['code_challenge'] = query_dict.get('code_challenge', '')
        self.params['code_challenge_method'] = query_dict.get('code_challenge_method', '')
1343822
def post(self):
        
        self._construct_post_data()

        post_args = {"json": self.post_data}
        self.http_method_args.update(post_args)

        return self.http_method("POST")
903434
def community_post_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/community/posts.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
490164
def _build_params(self):
        
        d = OrderedDict()
        d['purpose_codes'] = 'ADULT'
        d['queryDate'] = self._valid_date
        d['from_station'] = self._from_station_telecode
        d['to_station'] = self._to_station_telecode
        return d
76764
def create_resources(self, creation_parameters, project):
        
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url('project', project, 'str')
        content = self._serialize.body(creation_parameters, '{ResourceCreationParameter}')
        response = self._send(http_method='POST',
                              location_id='43201899-7690-4870-9c79-ab69605f21ed',
                              version='5.1-preview.1',
                              route_values=route_values,
                              content=content)
        return self._deserialize('CreatedResources', response)
1038223
def get_create_api(self, resource):
        

        create_api = {
            'path': '/%s/' % resource.get_api_name(),
            'description': 'Operations on %s' % resource.model.__name__,
            'operations': [
                {
                    'httpMethod': 'POST',
                    'nickname': 'create%ss' % resource.model
                    .__name__,
                    'summary': 'Create %ss' % resource.model.__name__,
                    'parameters': [{
                        'description': '%s object' % (resource.model.__name__),
                        'paramType': 'body',
                        'required': True,
                        'allowMultiple': False,
                        'dataType': resource.model.__name__
                    }]
                }
            ]
        }

        return create_api
863189
def create(self, parameters):
        
        response = self._client.session.post(
            '{url}/new'.format(url=self.endpoint_url), data=parameters
        )
        return self.process_response(response)
910028
def post_parse(self, uri, params={}, data={}):
        '''
        '''
        return self._request_parse(self.post, uri, params, data)
993357
def fetch_post_data(self):
        '''
        
        '''
        post_data = {}
        ext_dic = {}
        for key in self.request.arguments:
            if key.startswith('def_'):
                ext_dic[key] = self.get_argument(key)
            else:
                post_data[key] = self.get_arguments(key)[0]

        post_data['user_name'] = self.userinfo.user_name

        ext_dic = dict(ext_dic, **self.ext_post_data(postdata=post_data))

        return (post_data, ext_dic)
332466
def _construct_params(params, required_keys, opt_keys=None):
        
        try:
            params_list = [params.pop(key) for key in required_keys]
        except KeyError as e:
            raise MissingParameter(
                'Missing expected request parameter: %s' % e)
        if opt_keys:
            params_list.extend([params.pop(key)
                                for key in opt_keys if key in params])
        return '/'.join(str(p) for p in params_list)
726419
def do_post_construct(self, request_args, **kwargs):
        
        _args = self.method_args('post_construct', **kwargs)

        for meth in self.post_construct:
            request_args = meth(request_args, service=self, **_args)

        return request_args
910895
def create(self, data={}, **kwargs):
        "
        url = self.base_url
        return self.post_url(url, data, **kwargs)