ok

Mini Shell

Direktori : /opt/imunify360/venv/lib/python3.11/site-packages/urllib3/__pycache__/
Upload File :
Current File : //opt/imunify360/venv/lib/python3.11/site-packages/urllib3/__pycache__/request.cpython-311.pyc

�

m��fa��L�ddlmZddlmZddlmZdgZGd�de��ZdS)�)�absolute_import�)�encode_multipart_formdata)�	urlencode�RequestMethodsc�R�eZdZdZhd�Zd
d�Z				dd�Zdd�Zdd�Z				dd	�Z	dS)
ra�
    Convenience mixin for classes who implement a :meth:`urlopen` method, such
    as :class:`urllib3.HTTPConnectionPool` and
    :class:`urllib3.PoolManager`.

    Provides behavior for making common types of HTTP request methods and
    decides which type of request field encoding to use.

    Specifically,

    :meth:`.request_encode_url` is for sending requests whose fields are
    encoded in the URL (such as GET, HEAD, DELETE).

    :meth:`.request_encode_body` is for sending requests whose fields are
    encoded in the *body* of the request using multipart or www-form-urlencoded
    (such as for POST, PUT, PATCH).

    :meth:`.request` is for making any kind of request, it will look up the
    appropriate encoding format and use one of the above two methods to make
    the request.

    Initializer parameters:

    :param headers:
        Headers to include with all requests, unless other headers are given
        explicitly.
    >�GET�HEAD�DELETE�OPTIONSNc��|pi|_dS�N)�headers)�selfrs  �F/opt/imunify360/venv/lib64/python3.11/site-packages/urllib3/request.py�__init__zRequestMethods.__init__(s���}�"�����Tc� �td���)NzMClasses extending RequestMethods must implement their own ``urlopen`` method.)�NotImplementedError)r�method�url�bodyr�encode_multipart�multipart_boundary�kws        r�urlopenzRequestMethods.urlopen+s��"�
,�
�
�	
rc��|���}||d<||jvr|j||f||d�|��S|j||f||d�|��S)a�
        Make a request using :meth:`urlopen` with the appropriate encoding of
        ``fields`` based on the ``method`` used.

        This is a convenience method that requires the least amount of manual
        effort. It can be used in most situations, while still having the
        option to drop down to more specific methods when necessary, such as
        :meth:`request_encode_url`, :meth:`request_encode_body`,
        or even the lowest level :meth:`urlopen`.
        �request_url)�fieldsr)�upper�_encode_url_methods�request_encode_url�request_encode_body)rrrrr�
urlopen_kws      r�requestzRequestMethods.request:s���������$'�
�=�!��T�-�-�-�*�4�*����$*�G���?I���
�,�4�+����$*�G���?I���
rc��|�|j}d|i}|�|��|r|dt|��zz
}|j||fi|��S)z�
        Make a request using :meth:`urlopen` with the ``fields`` encoded in
        the url. This is useful for request methods like GET, HEAD, DELETE, etc.
        Nr�?)r�updaterr)rrrrrr$�extra_kws       rr"z!RequestMethods.request_encode_urlRsg��
�?��l�G��w�'�����
�#�#�#��	+��3��6�*�*�*�*�C��t�|�F�C�4�4�8�4�4�4rc�,�|�|j}dii}|rGd|vrtd���|rt||���\}	}
nt|��d}
}	|	|d<d|
i|d<|d�|��|�|��|j||fi|��S)a�
        Make a request using :meth:`urlopen` with the ``fields`` encoded in
        the body. This is useful for request methods like POST, PUT, PATCH, etc.

        When ``encode_multipart=True`` (default), then
        :func:`urllib3.encode_multipart_formdata` is used to encode
        the payload with the appropriate content type. Otherwise
        :func:`urllib.parse.urlencode` is used with the
        'application/x-www-form-urlencoded' content type.

        Multipart encoding must be used when posting files, and it's reasonably
        safe to use it in other times too. However, it may break request
        signing, such as with OAuth.

        Supports an optional ``fields`` parameter of key/value strings AND
        key/filetuple. A filetuple is a (filename, data, MIME type) tuple where
        the MIME type is optional. For example::

            fields = {
                'foo': 'bar',
                'fakefile': ('foofile.txt', 'contents of foofile'),
                'realfile': ('barfile.txt', open('realfile').read()),
                'typedfile': ('bazfile.bin', open('bazfile').read(),
                              'image/jpeg'),
                'nonamefile': 'contents of nonamefile field',
            }

        When uploading a file, providing a filename (the first parameter of the
        tuple) is optional but recommended to best mimic behavior of browsers.

        Note that if ``headers`` are supplied, the 'Content-Type' header will
        be overwritten because it depends on the dynamic random boundary string
        which is used to compose the body of the request. The random boundary
        string can be explicitly set with the ``multipart_boundary`` parameter.
        NrrzFrequest got values for both 'fields' and 'body', can only specify one.)�boundaryz!application/x-www-form-urlencodedzContent-Type)r�	TypeErrorrrr(r)rrrrrrrr$r)r�content_types           rr#z"RequestMethods.request_encode_bodybs���Z�?��l�G��r�?���	A���#�#��\���� �
�%>��%7�&�&�&�"��l�l�
�f�%�%�7�#��
 $�H�V��#1�<�"@�H�Y�����"�"�7�+�+�+����
�#�#�#��t�|�F�C�4�4�8�4�4�4rr)NNTN)NN)
�__name__�
__module__�__qualname__�__doc__r!rrr%r"r#�rrrr	s���������8?�>�>��%�%�%�%�����

�

�

�

�����05�5�5�5�(����H5�H5�H5�H5�H5�H5rN)	�
__future__r�filepostr�packages.six.moves.urllib.parser�__all__�objectrr2rr�<module>r8s���&�&�&�&�&�&�/�/�/�/�/�/�6�6�6�6�6�6��
��a5�a5�a5�a5�a5�V�a5�a5�a5�a5�a5r

Zerion Mini Shell 1.0