Ë
    Eü´jÊ9  ã                  ó²  — 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œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Z"edddddddddeddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d d„«       Z#dddddddeddœ		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d!d„Z$dddddddeddœ		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d!d„Z%dddddddeddœ		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d!d„Z&dddddddddddeddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d"d„Z'dddddddddddeddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d"d„Z(dddddddddddeddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d"d„Z)ddddddedddœ		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d#d„Z*dddddddddddeddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d"d„Z+eddddddedddeee
edœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d$d„«       Z,y)%é    )Ú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_envc               ó„   — t        ||
|||¬«      5 }|j                  | ||||||||	|¬«
      cddd«       S # 1 sw Y   yxY w)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   ©
ÚmethodÚurlr%   r&   r'   r(   r$   r)   r+   r.   N)r   r!   )r4   r5   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   Úclients                   úI/root/workspace/ytshorts/venv/lib/python3.12/site-packages/httpx2/_api.pyr!   r!   2   se   € ôf 
ØØØØØô
ð 
ð 
Ø�~‰~ØØØØØØØØØØ-ð ó 
÷
÷ 
ò 
ús   ‘6¶?c             #  ó¾   K  — t        ||
|||¬«      5 }|j                  | ||||||||	|¬«
      5 }|–— ddd«       ddd«       y# 1 sw Y   ŒxY w# 1 sw Y   yxY w­w)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
    r2   r3   N)r   r"   )r4   r5   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r6   Úresponses                    r7   r"   r"   z   s‹   è ø€ ô: 
ØØØØØô
ð ð 
Ø�]‰]ØØØØØØØØØØ-ð ó 
ð 	ð ØŠN÷	÷ð ÷	ð 	ú÷ð üó1   ‚A“A¯A´A¼	AÁA	Á
AÁAÁA©	r$   r)   r*   r+   r,   r.   r/   r-   r0   c       	        ó.   — 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.
    ÚGETr;   ©r!   ©
r5   r$   r)   r*   r+   r,   r.   r/   r-   r0   s
             r7   r   r   ­   s2   € ô* ØØØØØØØØ)ØØØôð ó    c       	        ó.   — 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.
    ÚOPTIONSr;   r>   r?   s
             r7   r   r   Ñ   s2   € ô* ØØØØØØØØ)ØØØôð r@   c       	        ó.   — 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.
    ÚHEADr;   r>   r?   s
             r7   r   r   õ   s2   € ô* ØØØØØØØØ)ØØØôð r@   ©r%   r&   r'   r(   r$   r)   r*   r+   r,   r.   r/   r-   r0   c               ó6   — t        d| |||||||||	|
|||¬«      S )zL
    Sends a `POST` request.

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

    **Parameters**: See `httpx2.request`.
    ÚPUTrE   r>   rH   s                 r7   r   r   B  s>   € ô, ØØØØØØØØØØØØ)ØØØôð r@   c               ó6   — t        d| |||||||||	|
|||¬«      S )zM
    Sends a `PATCH` request.

    **Parameters**: See `httpx2.request`.
    ÚPATCHrE   r>   rH   s                 r7   r   r   k  ó>   € ô, ØØØØØØØØØØØØ)ØØØôð r@   )	r$   r)   r*   r+   r,   r.   r-   r/   r0   c       	        ó.   — 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.
    ÚDELETEr;   r>   )
r5   r$   r)   r*   r+   r,   r.   r-   r/   r0   s
             r7   r   r   ”  s2   € ô* ØØØØØØØØ)ØØØôð r@   c               ó6   — t        d| |||||||||	|
|||¬«      S )zM
    Sends a `QUERY` request.

    **Parameters**: See `httpx2.request`.
    ÚQUERYrE   r>   rH   s                 r7   r    r    ¸  rM   r@   )r$   r)   r*   r+   r,   r.   r-   r/   r0   ÚsubprotocolsÚmax_message_size_bytesÚ
queue_sizeÚkeepalive_ping_interval_secondsÚkeepalive_ping_timeout_secondsc             #  ó¾   K  — t        |||||	¬«      5 }|j                  | |||||
||||¬«
      5 }|–— ddd«       ddd«       y# 1 sw Y   ŒxY w# 1 sw Y   yxY w­w)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`.
    r2   )	r$   r)   r+   r.   rR   rS   rT   rU   rV   N)r   r#   )r5   r$   r)   r*   r+   r,   r.   r-   r/   r0   rR   rS   rT   rU   rV   r6   Úsessions                    r7   r#   r#   á  sŽ   è ø€ ô@ 
ØØØØØô
ð ð 
Ø×ÑØØØØØ-Ø%Ø#9Ø!Ø,KØ+Ið ó 
ð 	ð ØŠM÷	÷ð ÷	ð 	ú÷ð ür:   ) r4   Ústrr5   ú	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   rd   Úreturnr   ) r4   rY   r5   rZ   r$   r[   r%   r\   r&   r]   r'   r^   r(   r_   r)   r`   r*   ra   r+   rb   r,   rc   r-   r   r.   rd   r/   re   r0   rd   rf   zGenerator[Response])r5   rZ   r$   r[   r)   r`   r*   ra   r+   rb   r,   rc   r.   rd   r/   re   r-   r   r0   rd   rf   r   )r5   rZ   r%   r\   r&   r]   r'   r^   r(   r_   r$   r[   r)   r`   r*   ra   r+   rb   r,   rc   r.   rd   r/   re   r-   r   r0   rd   rf   r   )r5   rZ   r$   r[   r)   r`   r*   ra   r+   rb   r,   rc   r.   rd   r-   r   r/   re   r0   rd   rf   r   ) r5   rZ   r$   r[   r)   r`   r*   ra   r+   rb   r,   rc   r.   rd   r-   r   r/   re   r0   rd   rR   zlist[str] | NonerS   ÚintrT   rg   rU   úfloat | NonerV   rh   rf   zGenerator[WebSocketSession])-Ú
__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#   © r@   r7   ú<module>rw      s)  ðÝ "ã Ý %Ý %å ÷õ õ ÷
÷ 
õ 
õ à	×ÒÛå1ò€ð& &*Ø%)Ø#Ø!%Ø"Ø"&Ø"&Ø!Ø#Ø2Ø"Ø*.Øñ!E
ØðE
à	ðE
ð #ð	E
ð
 #ðE
ð ðE
ð ðE
ð ðE
ð  ðE
ð  ðE
ð ðE
ð ð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ð ð2ð (ð2ð ð2ð #ð2ð  ð2ð ð2ð &2ð2ð  %1ð!2ð" !ò#2ó ñ2r@   