
    8	i                         d Z ddlmZ ddlZddlZddlZddlmZ ddlm	Z	 ddlm
Z
  ej        e          Z G d de
j                  Z G d d	e
j                  ZdS )
z9Transport adapter for http.client, for internal use only.    N)_helpers)
exceptions)	transportc                   Z    e Zd ZdZd Zed             Zed             Zed             ZdS )Responsezhttp.client transport response adapter.

    Args:
        response (http.client.HTTPResponse): The raw http client response.
    c                     |j         | _        d |                                D             | _        |                                | _        d S )Nc                 >    i | ]\  }}|                                 |S  )lower).0keyvalues      Z/srv/django_bis/venv311/lib/python3.11/site-packages/google/auth/transport/_http_client.py
<dictcomp>z%Response.__init__.<locals>.<dictcomp>&   s&    TTT
UeTTT    )status_status
getheaders_headersread_data)selfresponses     r   __init__zResponse.__init__$   s?    TTh>Q>Q>S>STTT]]__


r   c                     | j         S N)r   r   s    r   r   zResponse.status)   s
    |r   c                     | j         S r   )r   r   s    r   headerszResponse.headers-   s
    }r   c                     | j         S r   )r   r   s    r   datazResponse.data1   s
    zr   N)	__name__
__module____qualname____doc__r   propertyr   r   r!   r
   r   r   r   r      s~         % % %
   X   X   X  r   r   c                       e Zd ZdZ	 ddZdS )Requestz&http.client transport request adapter.GETNc                    |t           j        }|i }t          j                            |          }t          j                            dd|j        |j        |j        f          }|j	        dk    r,t          j        d                    |j	                            t          j        |j        |          }		 t!          j        t$          ||||            |	j        ||f||d| |	                                }
t!          j        t$          |
           t-          |
          |	                                 S # t          j        t           j        f$ r}t          j        |          }||d}~ww xY w# |	                                 w xY w)a;  Make an HTTP request using http.client.

        Args:
            url (str): The URI to be requested.
            method (str): The HTTP method to use for the request. Defaults
                to 'GET'.
            body (bytes): The payload / body in HTTP request.
            headers (Mapping): Request headers.
            timeout (Optional(int)): The number of seconds to wait for a
                response from the server. If not specified or if None, the
                socket global default timeout will be used.
            kwargs: Additional arguments passed throught to the underlying
                :meth:`~http.client.HTTPConnection.request` method.

        Returns:
            Response: The HTTP response.

        Raises:
            google.auth.exceptions.TransportError: If any exception occurred.
        N httpzDhttp.client transport only supports the http scheme, {}was specified)timeout)bodyr   )socket_GLOBAL_DEFAULT_TIMEOUTurllibparseurlsplit
urlunsplitpathqueryfragmentschemer   TransportErrorformathttp_clientHTTPConnectionnetlocr   request_log_LOGGERrequestgetresponseresponse_logr   closeHTTPExceptionerror)r   urlmethodr.   r   r-   kwargspartsr5   
connectionr   
caught_excnew_excs                r   __call__zRequest.__call__9   s   0 ?4G ?G %%c**|&&UZen=
 
 <6!!+  &u| 4 4  
 !/gNNN
	 &#tWEEEJvtR$RR6RRR!--//H!'8444H%%  )6<8 	* 	* 	* /
;;Gz)	*
 s%   8A+D8 8E/E**E//E2 2F)r)   NNN)r"   r#   r$   r%   rM   r
   r   r   r(   r(   6   s5        00 CG: : : : : :r   r(   )r%   http.clientclientr;   loggingr/   r1   google.authr   r   r   	getLoggerr"   r?   r   r(   r
   r   r   <module>rS      s    @ ? ! ! ! ! ! !                " " " " " " ! ! ! ! ! !
'
H
%
%    y!   2= = = = =i = = = = =r   