§
    ëXÊjÊ9  ã                  ól  — d dl mZ d dlZd dlmZ d dlmZ ddlmZ ddl	m
Z
mZmZmZmZ ddlmZ dd	lmZmZmZmZmZmZmZmZmZ dd
lmZ ej        r
d dlZddlm Z  g d¢Z!dddddddddeddddœdHd/„Z"edddddddddeddddœdId1„¦   «         Z#dddddddedd2œ	dJd3„Z$dddddddedd2œ	dJd4„Z%dddddddedd2œ	dJd5„Z&dddddddddddedd6œdKd7„Z'dddddddddddedd6œdKd8„Z(dddddddddddedd6œdKd9„Z)ddddddeddd:œ	dLd;„Z*dddddddddddedd6œdKd<„Z+eddddddedddeee
ed=œdMdG„¦   «         Z,dS )Né    )ÚannotationsN)Ú	Generator)Úcontextmanageré   )ÚClient)Ú'DEFAULT_KEEPALIVE_PING_INTERVAL_SECONDSÚ&DEFAULT_KEEPALIVE_PING_TIMEOUT_SECONDSÚDEFAULT_MAX_MESSAGE_SIZE_BYTESÚDEFAULT_QUEUE_SIZEÚDEFAULT_TIMEOUT_CONFIG)ÚResponse)	Ú	AuthTypesÚCookieTypesÚHeaderTypesÚ
ProxyTypesÚQueryParamTypesÚRequestContentÚRequestDataÚRequestFilesÚTimeoutTypes)ÚURL)ÚWebSocketSession)ÚdeleteÚgetÚheadÚoptionsÚpatchÚpostÚputÚqueryÚrequestÚstreamÚ	websocketFT)ÚparamsÚcontentÚdataÚfilesÚjsonÚheadersÚcookiesÚauthÚproxyÚtimeoutÚfollow_redirectsÚverifyÚ	trust_envÚmethodÚstrÚurlú	URL | strr$   úQueryParamTypes | Noner%   úRequestContent | Noner&   úRequestData | Noner'   úRequestFiles | Noner(   útyping.Any | Noner)   úHeaderTypes | Noner*   úCookieTypes | Noner+   úAuthTypes | Noner,   úProxyTypes | Noner-   r   r.   Úboolr/   ússl.SSLContext | str | boolr0   Úreturnr   c               óœ   — t          ||
|||¬¦  «        5 }|                     | ||||||||	|¬¦
  «
        cddd¦  «         S # 1 swxY w Y   dS )aÖ  Sends an HTTP request.

    Parameters:
        method: HTTP method for the new `Request` object: `GET`, `OPTIONS`, `HEAD`, `POST`, `PUT`, `PATCH`, `DELETE`,
            or `QUERY`.
        url: URL for the new `Request` object.
        params: *(optional)* Query parameters to include in the URL, as a string, dictionary, or sequence of two-tuples.
        content: *(optional)* Binary content to include in the body of the request, as bytes or a byte iterator.
        data: *(optional)* Form data to include in the body of the request, as a dictionary.
        files: *(optional)* A dictionary of upload files to include in the body of the request.
        json: *(optional)* A JSON serializable object to include in the body of the request.
        headers: *(optional)* Dictionary of HTTP headers to include in the request.
        cookies: *(optional)* Dictionary of Cookie items to include in the request.
        auth: *(optional)* An authentication class to use when sending the request.
        proxy: *(optional)* A proxy URL where all the traffic should be routed.
        timeout: *(optional)* The timeout configuration to use when sending the request.
        follow_redirects: *(optional)* Enables or disables HTTP redirects.
        verify: *(optional)* Either `True` to use an SSL context with the default CA bundle, `False` to disable
            verification, or an instance of `ssl.SSLContext` to use a custom context.
        trust_env: *(optional)* Enables or disables usage of environment variables for configuration.

    Returns:
        The `Response` object.

    Usage:

    ```
    >>> import httpx2
    >>> response = httpx2.request('GET', 'https://httpbin.org/get')
    >>> response
    <Response [200 OK]>
    ```
    ©r*   r,   r/   r-   r0   ©
r1   r3   r%   r&   r'   r(   r$   r)   r+   r.   N)r   r!   )r1   r3   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   Úclients                   ú<C:\Projects\Historical\venv\Lib\site-packages\httpx2/_api.pyr!   r!   2   sÁ   € õf 
ØØØØØð
ñ 
ô 
ð 
ð 
Ø�~Š~ØØØØØØØØØØ-ð ñ 
ô 
ð
ð 
ð 
ð 
ñ 
ô 
ð 
ð 
ð 
ð 
ð 
ð 
øøøð 
ð 
ð 
ð 
ð 
ð 
s   •AÁAÁAúGenerator[Response]c             #  óÚ   K  — t          ||
|||¬¦  «        5 }|                     | ||||||||	|¬¦
  «
        5 }|V — ddd¦  «         n# 1 swxY w Y   ddd¦  «         dS # 1 swxY w Y   dS )zø
    Alternative to `httpx2.request()` that streams the response body
    instead of loading it into memory at once.

    **Parameters**: See `httpx2.request`.

    See also: [Streaming Responses][0]

    [0]: quickstart.md#streaming-responses
    rB   rC   N)r   r"   )r1   r3   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   rD   Úresponses                    rE   r"   r"   z   s%  è è € õ: 
ØØØØØð
ñ 
ô 
ð ð 
Ø�]Š]ØØØØØØØØØØ-ð ñ 
ô 
ð 	ð ØˆNˆNˆNð	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	ðð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð ó3   — A ·A¼A ÁA	ÁA ÁA	ÁA Á A$Á'A$©	r$   r)   r*   r+   r,   r.   r/   r-   r0   c       	        ó6   — t          d| |||||||||	¬¦  «        S )zì
    Sends a `GET` request.

    **Parameters**: See `httpx2.request`.

    Note that the `data`, `files`, `json` and `content` parameters are not available
    on this function, as `GET` requests should not include a request body.
    ÚGETrJ   ©r!   ©
r3   r$   r)   r*   r+   r,   r.   r/   r-   r0   s
             rE   r   r   ­   s<   € õ* ØØØØØØØØ)ØØØðñ ô ð ó    c       	        ó6   — t          d| |||||||||	¬¦  «        S )zõ
    Sends an `OPTIONS` request.

    **Parameters**: See `httpx2.request`.

    Note that the `data`, `files`, `json` and `content` parameters are not available
    on this function, as `OPTIONS` requests should not include a request body.
    ÚOPTIONSrJ   rM   rN   s
             rE   r   r   Ñ   s<   € õ* ØØØØØØØØ)ØØØðñ ô ð rO   c       	        ó6   — t          d| |||||||||	¬¦  «        S )zî
    Sends a `HEAD` request.

    **Parameters**: See `httpx2.request`.

    Note that the `data`, `files`, `json` and `content` parameters are not available
    on this function, as `HEAD` requests should not include a request body.
    ÚHEADrJ   rM   rN   s
             rE   r   r   õ   s<   € õ* ØØØØØØØØ)ØØØðñ ô ð rO   ©r%   r&   r'   r(   r$   r)   r*   r+   r,   r.   r/   r-   r0   c               ó>   — t          d| |||||||||	|
|||¬¦  «        S )zL
    Sends a `POST` request.

    **Parameters**: See `httpx2.request`.
    ÚPOSTrT   rM   ©r3   r%   r&   r'   r(   r$   r)   r*   r+   r,   r.   r/   r-   r0   s                 rE   r   r     sH   € õ, ØØØØØØØØØØØØ)ØØØðñ ô ð rO   c               ó>   — t          d| |||||||||	|
|||¬¦  «        S )zK
    Sends a `PUT` request.

    **Parameters**: See `httpx2.request`.
    ÚPUTrT   rM   rW   s                 rE   r   r   B  sH   € õ, ØØØØØØØØØØØØ)ØØØðñ ô ð rO   c               ó>   — t          d| |||||||||	|
|||¬¦  «        S )zM
    Sends a `PATCH` request.

    **Parameters**: See `httpx2.request`.
    ÚPATCHrT   rM   rW   s                 rE   r   r   k  óH   € õ, ØØØØØØØØØØØØ)ØØØðñ ô ð rO   )	r$   r)   r*   r+   r,   r.   r-   r/   r0   c       	        ó6   — t          d| |||||||||	¬¦  «        S )zò
    Sends a `DELETE` request.

    **Parameters**: See `httpx2.request`.

    Note that the `data`, `files`, `json` and `content` parameters are not available
    on this function, as `DELETE` requests should not include a request body.
    ÚDELETErJ   rM   )
r3   r$   r)   r*   r+   r,   r.   r-   r/   r0   s
             rE   r   r   ”  s<   € õ* ØØØØØØØØ)ØØØðñ ô ð rO   c               ó>   — t          d| |||||||||	|
|||¬¦  «        S )zM
    Sends a `QUERY` request.

    **Parameters**: See `httpx2.request`.
    ÚQUERYrT   rM   rW   s                 rE   r    r    ¸  r\   rO   )r$   r)   r*   r+   r,   r.   r-   r/   r0   ÚsubprotocolsÚmax_message_size_bytesÚ
queue_sizeÚkeepalive_ping_interval_secondsÚkeepalive_ping_timeout_secondsra   úlist[str] | Nonerb   Úintrc   rd   úfloat | Nonere   úGenerator[WebSocketSession]c             #  óÚ   K  — t          |||||	¬¦  «        5 }|                     | |||||
||||¬¦
  «
        5 }|V — ddd¦  «         n# 1 swxY w Y   ddd¦  «         dS # 1 swxY w Y   dS )aL  
    Open a WebSocket session.

    The session is closed automatically when exiting the context manager.

    ```python
    with httpx2.websocket("ws://localhost:8000/ws") as ws:
        ws.send_text("Hello!")
        message = ws.receive_text()
    ```

    **Parameters**: See `httpx2.request` and `httpx2.Client.websocket`.
    rB   )	r$   r)   r+   r.   ra   rb   rc   rd   re   N)r   r#   )r3   r$   r)   r*   r+   r,   r.   r-   r/   r0   ra   rb   rc   rd   re   rD   Úsessions                    rE   r#   r#   á  s(  è è € õ@ 
ØØØØØð
ñ 
ô 
ð ð 
Ø×ÒØØØØØ-Ø%Ø#9Ø!Ø,KØ+Ið ñ 
ô 
ð 	ð ØˆMˆMˆMð	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	ðð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð rI   ) r1   r2   r3   r4   r$   r5   r%   r6   r&   r7   r'   r8   r(   r9   r)   r:   r*   r;   r+   r<   r,   r=   r-   r   r.   r>   r/   r?   r0   r>   r@   r   ) r1   r2   r3   r4   r$   r5   r%   r6   r&   r7   r'   r8   r(   r9   r)   r:   r*   r;   r+   r<   r,   r=   r-   r   r.   r>   r/   r?   r0   r>   r@   rF   )r3   r4   r$   r5   r)   r:   r*   r;   r+   r<   r,   r=   r.   r>   r/   r?   r-   r   r0   r>   r@   r   )r3   r4   r%   r6   r&   r7   r'   r8   r(   r9   r$   r5   r)   r:   r*   r;   r+   r<   r,   r=   r.   r>   r/   r?   r-   r   r0   r>   r@   r   )r3   r4   r$   r5   r)   r:   r*   r;   r+   r<   r,   r=   r.   r>   r-   r   r/   r?   r0   r>   r@   r   ) r3   r4   r$   r5   r)   r:   r*   r;   r+   r<   r,   r=   r.   r>   r-   r   r/   r?   r0   r>   ra   rf   rb   rg   rc   rg   rd   rh   re   rh   r@   ri   )-Ú
__future__r   ÚtypingÚcollections.abcr   Ú
contextlibr   Ú_clientr   Ú_configr   r	   r
   r   r   Ú_modelsr   Ú_typesr   r   r   r   r   r   r   r   r   Ú_urlsr   ÚTYPE_CHECKINGÚsslÚwebsockets._apir   Ú__all__r!   r"   r   r   r   r   r   r   r   r    r#   © rO   rE   ú<module>rz      s{  ðØ "Ð "Ð "Ð "Ð "Ð "à €€€Ø %Ð %Ð %Ð %Ð %Ð %Ø %Ð %Ð %Ð %Ð %Ð %à Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ð Ð Ð Ð Ð Ð ð
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð Ð Ð Ð Ð Ð à	Ôð 2Ø€J€J€Jà1Ð1Ð1Ð1Ð1Ð1ðð ð €ð& &*Ø%)Ø#Ø!%Ø"Ø"&Ø"&Ø!Ø#Ø2Ø"Ø*.Øð!E
ð E
ð E
ð E
ð E
ð E
ðP ð
 &*Ø%)Ø#Ø!%Ø"Ø"&Ø"&Ø!Ø#Ø2Ø"Ø*.Øð!/ð /ð /ð /ð /ñ „ð/ðj &*Ø"&Ø"&Ø!Ø#Ø"Ø*.Ø2Øð!ð !ð !ð !ð !ð !ðN &*Ø"&Ø"&Ø!Ø#Ø"Ø*.Ø2Øð!ð !ð !ð !ð !ð !ðN &*Ø"&Ø"&Ø!Ø#Ø"Ø*.Ø2Øð!ð !ð !ð !ð !ð !ðN &*Ø#Ø!%Ø"Ø%)Ø"&Ø"&Ø!Ø#Ø"Ø*.Ø2Øð&ð &ð &ð &ð &ð &ðX &*Ø#Ø!%Ø"Ø%)Ø"&Ø"&Ø!Ø#Ø"Ø*.Ø2Øð&ð &ð &ð &ð &ð &ðX &*Ø#Ø!%Ø"Ø%)Ø"&Ø"&Ø!Ø#Ø"Ø*.Ø2Øð&ð &ð &ð &ð &ð &ðX &*Ø"&Ø"&Ø!Ø#Ø"Ø2Ø*.Øð!ð !ð !ð !ð !ð !ðN &*Ø#Ø!%Ø"Ø%)Ø"&Ø"&Ø!Ø#Ø"Ø*.Ø2Øð&ð &ð &ð &ð &ð &ðR ð &*Ø"&Ø"&Ø!Ø#Ø"Ø2Ø*.ØØ%)Ø"@Ø(Ø4[Ø3Yð!2ð 2ð 2ð 2ð 2ñ „ð2ð 2ð 2rO   