Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/request.cpython-312.pyc

�

4Μg#����ddlmZddlZddlmZddlmZddlmZdgZ	Gd�de
�Zejs7Gd	�d
ejej�Zeeje_yy)�)�absolute_importN�)�encode_multipart_formdata)�six)�	urlencode�RequestMethodsc�P�eZdZdZhd�Zd	d�Z				d
d�Zdd�Zdd�Z				d
d�Z	y)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��|xsi|_y�N)�headers)�selfrs  �F/usr/local/lib/python3.12/site-packages/pip/_vendor/urllib3/request.py�__init__zRequestMethods.__init__+s
���}�"���c��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��|j�}||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)rrrr r�
urlopen_kws      r�requestzRequestMethods.request=s��������$'�
�=�!��T�-�-�-�*�4�*�*����$*�G��?I��
�,�4�+�+����$*�G��?I��
rc��|�|j}d|i}|j|�|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.
        r�?)r�updaterr)rrrr rr%�extra_kws       rr#z!RequestMethods.request_encode_urlUsW��
�?��l�l�G��w�'�����
�#���3��6�*�*�*�C��t�|�|�F�C�4�8�4�4rc��|�|j}dii}|r;d|vrtd��|rt||��\}	}
n
t|�d}
}	|	|d<d|
i|d<|dj	|�|j	|�|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.
        rrzFrequest got values for both 'fields' and 'body', can only specify one.)�boundaryz!application/x-www-form-urlencodedzContent-Type)r�	TypeErrorrrr)r)rrrr rrrr%r*r�content_types           rr$z"RequestMethods.request_encode_bodyes���Z�?��l�l�G��r�?�����#��\��� �%>��%7�&�"��l�
�f�%�7�#��
 $�H�V��#1�<�"@�H�Y�����"�"�7�+����
�#��t�|�|�F�C�4�8�4�4rr)NNTN)NN)
�__name__�
__module__�__qualname__�__doc__r"rrr&r#r$�rrrrsE���8?��%�����

��05�(����H5rc��eZdZd�Zy)�
RequestModulec��td��)z�
            If user tries to call this module directly urllib3 v2.x style raise an error to the user
            suggesting they may need urllib3 v2
            z�'module' object is not callable
urllib3.request() method is not supported in this release, upgrade to urllib3 v2 to use it
see https://urllib3.readthedocs.io/en/stable/v2-migration-guide.html)r-)r�args�kwargss   r�__call__zRequestModule.__call__�s��
�W��
rN)r/r0r1r9r3rrr5r5�s��
	rr5)�
__future__r�sys�filepostr�packagesr�packages.six.moves.urllib.parser�__all__�objectr�PY2�modulesr/�	__class__r5r3rr�<module>rDsg��&�
�/��6��
��a5�V�a5�H�w�w�����H�-�7�7��'4�C�K�K���#�r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists