o
    Þ­j3  ã                   @  s  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
 ddlmZmZmZmZmZmZmZmZmZmZmZmZ dd	lmZ g d
¢ZddddddddddedddddœdFd1d2„ZeddddddddddedddddœdGd4d5„ƒZdddddddddedd6œdHd7d8„Zdddddddddedd6œdHd9d:„Zdddddddddedd6œdHd;d<„Zdddddddddddddedd=œdId>d?„Z dddddddddddddedd=œdId@dA„Z!dddddddddddddedd=œdIdBdC„Z"dddddddddedd6œdHdDdE„Z#dS )Jé    )ÚannotationsN)Úcontextmanageré   )ÚClient)ÚDEFAULT_TIMEOUT_CONFIG)ÚResponse)Ú	AuthTypesÚ	CertTypesÚCookieTypesÚHeaderTypesÚProxiesTypesÚ
ProxyTypesÚQueryParamTypesÚRequestContentÚRequestDataÚRequestFilesÚTimeoutTypesÚVerifyTypes)ÚURL)	ÚdeleteÚgetÚheadÚoptionsÚpatchÚpostÚputÚrequestÚstreamFT)ÚparamsÚcontentÚdataÚfilesÚjsonÚheadersÚcookiesÚauthÚproxyÚproxiesÚtimeoutÚfollow_redirectsÚverifyÚcertÚ	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'   úProxiesTypes | Noner(   r   r)   Úboolr*   r   r+   úCertTypes | Noner,   Úreturnr   c                C  sX   t ||
|||||d��}|j| ||||||||	|d�
W  d  ƒ S 1 s%w   Y  dS )a©  
    Sends an HTTP request.

    **Parameters:**

    * **method** - HTTP method for the new `Request` object: `GET`, `OPTIONS`,
    `HEAD`, `POST`, `PUT`, `PATCH`, or `DELETE`.
    * **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.
    * **proxies** - *(optional)* A dictionary mapping proxy keys to proxy URLs.
    * **timeout** - *(optional)* The timeout configuration to use when sending
    the request.
    * **follow_redirects** - *(optional)* Enables or disables HTTP redirects.
    * **verify** - *(optional)* SSL certificates (a.k.a CA bundle) used to
    verify the identity of requested hosts. Either `True` (default CA bundle),
    a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
    (which will disable verification).
    * **cert** - *(optional)* An SSL certificate used by the requested host
    to authenticate the client. Either a path to an SSL certificate file, or
    two-tuple of (certificate file, key file), or a three-tuple of (certificate
    file, key file, password).
    * **trust_env** - *(optional)* Enables or disables usage of environment
    variables for configuration.

    **Returns:** `Response`

    Usage:

    ```
    >>> import httpx
    >>> response = httpx.request('GET', 'https://httpbin.org/get')
    >>> response
    <Response [200 OK]>
    ```
    ©r$   r&   r'   r+   r*   r(   r,   ©
r-   r/   r   r    r!   r"   r   r#   r%   r)   N)r   r   )r-   r/   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   Úclient© rA   úG/var/www/html/CropPilot/venv/lib/python3.10/site-packages/httpx/_api.pyr   &   s.   Gùö$÷r   útyping.Iterator[Response]c                c  s’   � t ||
|||||d��3}|j| ||||||||	|d�
�}|V  W d  ƒ n1 s*w   Y  W d  ƒ dS W d  ƒ dS 1 sBw   Y  dS )zô
    Alternative to `httpx.request()` that streams the response body
    instead of loading it into memory at once.

    **Parameters**: See `httpx.request`.

    See also: [Streaming Responses][0]

    [0]: /quickstart#streaming-responses
    r>   r?   N)r   r   )r-   r/   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r@   ÚresponserA   rA   rB   r   „   s:   €ùöô÷	"÷r   ©r   r#   r$   r%   r&   r'   r)   r+   r*   r(   r,   c                C  ó"   t d| |||||||||	|
|d�S )zë
    Sends a `GET` request.

    **Parameters**: See `httpx.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.
    ÚGETrE   ©r   ©r/   r   r#   r$   r%   r&   r'   r)   r+   r*   r(   r,   rA   rA   rB   r   »   ó   ór   c                C  rF   )zô
    Sends an `OPTIONS` request.

    **Parameters**: See `httpx.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.
    ÚOPTIONSrE   rH   rI   rA   rA   rB   r   ã   rJ   r   c                C  rF   )zí
    Sends a `HEAD` request.

    **Parameters**: See `httpx.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.
    ÚHEADrE   rH   rI   rA   rA   rB   r     rJ   r   ©r   r    r!   r"   r   r#   r$   r%   r&   r'   r)   r+   r*   r(   r,   c                C  ó.   t d| f|||||||||	|
|||||dœŽS )zK
    Sends a `POST` request.

    **Parameters**: See `httpx.request`.
    ÚPOSTrM   rH   ©r/   r   r    r!   r"   r   r#   r$   r%   r&   r'   r)   r+   r*   r(   r,   rA   rA   rB   r   3  ó(   þïr   c                C  rN   )zJ
    Sends a `PUT` request.

    **Parameters**: See `httpx.request`.
    ÚPUTrM   rH   rP   rA   rA   rB   r   `  rQ   r   c                C  rN   )zL
    Sends a `PATCH` request.

    **Parameters**: See `httpx.request`.
    ÚPATCHrM   rH   rP   rA   rA   rB   r   �  rQ   r   c                C  rF   )zñ
    Sends a `DELETE` request.

    **Parameters**: See `httpx.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.
    ÚDELETErE   rH   rI   rA   rA   rB   r   º  rJ   r   )$r-   r.   r/   r0   r   r1   r   r2   r    r3   r!   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   )$r-   r.   r/   r0   r   r1   r   r2   r    r3   r!   r4   r"   r5   r#   r6   r$   r7   r%   r8   r&   r9   r'   r:   r(   r   r)   r;   r*   r   r+   r<   r,   r;   r=   rC   )r/   r0   r   r1   r#   r6   r$   r7   r%   r8   r&   r9   r'   r:   r)   r;   r+   r<   r*   r   r(   r   r,   r;   r=   r   )"r/   r0   r   r2   r    r3   r!   r4   r"   r5   r   r1   r#   r6   r$   r7   r%   r8   r&   r9   r'   r:   r)   r;   r+   r<   r*   r   r(   r   r,   r;   r=   r   )$Ú
__future__r   ÚtypingÚ
contextlibr   Ú_clientr   Ú_configr   Ú_modelsr   Ú_typesr   r	   r
   r   r   r   r   r   r   r   r   r   Ú_urlsr   Ú__all__r   r   r   r   r   r   r   r   r   rA   rA   rA   rB   Ú<module>   s   8î^î9ó+ó+ó+ï0ï0ï0ó