steps.api.utils.request ======================= .. py:module:: steps.api.utils.request Attributes ---------- .. autoapisummary:: steps.api.utils.request.AUTHORIZATION_KEY steps.api.utils.request.CONTENT_TYPE_KEY steps.api.utils.request.JSON_HEADER_KEY steps.api.utils.request.FORM_HEADER_KEY Classes ------- .. autoapisummary:: steps.api.utils.request.Request Module Contents --------------- .. py:data:: AUTHORIZATION_KEY :value: 'Authorization' .. py:data:: CONTENT_TYPE_KEY :value: 'Content-Type' .. py:data:: JSON_HEADER_KEY :value: 'application/json' .. py:data:: FORM_HEADER_KEY :value: 'application/x-www-form-urlencoded' .. py:class:: Request(api=None, timeout: int = 3) Bases: :py:obj:`requests.Request` A user-created :class:`Request ` object. Used to prepare a :class:`PreparedRequest `, which is sent to the server. :param method: HTTP method to use. :param url: URL to send. :param headers: dictionary of headers to send. :param files: dictionary of {filename: fileobject} files to multipart upload. :param data: the body to attach to the request. If a dictionary or list of tuples ``[(key, value)]`` is provided, form-encoding will take place. :param json: json for the body to attach to the request (if files or data is not specified). :param params: URL parameters to append to the URL. If a dictionary or list of tuples ``[(key, value)]`` is provided, form-encoding will take place. :param auth: Auth handler or (user, pass) tuple. :param cookies: dictionary or CookieJar of cookies to attach to this request. :param hooks: dictionary of callback hooks, for internal usage. Usage:: >>> import requests >>> req = requests.Request('GET', 'https://httpbin.org/get') >>> req.prepare() .. py:attribute:: api :type: steps.api.utils.api.Api :value: None .. py:attribute:: method :value: '' .. py:attribute:: headers .. py:attribute:: params .. py:attribute:: body .. py:attribute:: original_path_url :value: '' .. py:attribute:: path_parameters .. py:attribute:: path_url :value: '' .. py:attribute:: url :value: '' .. py:attribute:: log :value: True .. py:attribute:: timeout :value: 3 .. py:attribute:: expected_status_code :value: '200' .. py:attribute:: response :value: None .. py:method:: set_header(key, value) .. py:method:: set_body(key, value) .. py:method:: set_param(key, value) .. py:method:: set_authorization_header(value) .. py:method:: set_json_content_type() .. py:method:: set_form_content_type() .. py:method:: set_url(path_url: str, path_parameters: dict = {}) .. py:method:: set_method(method: str) .. py:method:: send() .. py:method:: get_pretty_request() -> str .. py:method:: get_pretty_response() -> str .. py:method:: copy()