o
    Z�¿j1  ã                   @   s  g d ¢Z ddlmZmZmZ ddlmZ ddlmZm	Z	 ddl
mZmZ ddlmZ dd	lmZmZ dd
lmZmZmZ ddlmZmZ ddlmZmZmZmZmZmZm Z m!Z! ddl"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z) erwG dd„ de dd�Z*neZ*			d.dede+dee dee, dee- de!e  defdd„Z.de+de!e* defdd„Z/de+de!e* defdd„Z0de+de!e* defd d!„Z1de+de!e* defd"d#„Z2de+de!e* defd$d%„Z3de+de!e* defd&d'„Z4de+de!e* defd(d)„Z5de+de!e* defd*d+„Z6de+de!e* defd,d-„Z7dS )/) ÚSessionÚAsyncSessionÚBrowserTypeÚBrowserTypeLiteralÚ
CurlWsFlagÚrequestÚheadÚgetÚpostÚputÚpatchÚdeleteÚoptionsÚRequestsErrorÚCookiesÚHeadersÚRequestÚResponseÚAsyncWebSocketÚ	WebSocketÚWebSocketErrorÚWebSocketClosedÚWebSocketTimeoutÚWebSocketRetryStrategyÚWsCloseCodeÚExtraFingerprintsÚRetryStrategyÚCacheBackendÚFileCacheBackendÚCookieTypesÚHeaderTypesÚ	ProxySpecé    )ÚOptionalÚTYPE_CHECKINGÚ	TypedDicté   )r   é   )r   r   )r   r   )r   )r   r   )r   r   r   )r   r   )r   Ú
HttpMethodr    r   r   Ú
ThreadTypeÚRequestParamsÚUnpack)r   r   r   r   r   r   r   c                   @   s2   e Zd ZU ee ed< ee ed< ee ed< dS )ÚSessionRequestParamsÚthreadÚcurl_optionsÚdebugN)Ú__name__Ú
__module__Ú__qualname__r"   r(   Ú__annotations__ÚdictÚbool© r5   r5   úV/home/dinkstrade/pdmp/venv/lib/python3.10/site-packages/curl_cffi/requests/__init__.pyr+   C   s   
 r+   F)ÚtotalNÚmethodÚurlr,   r-   r.   ÚkwargsÚreturnc                 K   sX   |du rdn|}t |||d��}|jd| |dœ|¤ŽW  d  ƒ S 1 s%w   Y  dS )a  Send an http request.

    Parameters:
        method: http method for the request: GET/POST/PUT/DELETE etc.
        url: url for the requests.
        params: query string for the requests.
        data: form values(dict/list/tuple) or binary data to use in body,
            ``Content-Type: application/x-www-form-urlencoded`` will be added if a dict
            is given.
        content: raw request body as str, bytes, a byte iterable, or a binary file.
            ``AsyncSession`` also accepts an async byte iterable.
        json: json values to use in body, `Content-Type: application/json` will be added
            automatically.
        headers: headers to send.
        cookies: cookies to use.
        files: not supported, use ``multipart`` instead.
        auth: HTTP basic auth, a tuple of (username, password), only basic auth is
            supported.
        timeout: how many seconds to wait before giving up.
        allow_redirects: whether to allow redirection.
        max_redirects: max redirect counts, default 30, use -1 for unlimited.
        proxies: dict of proxies to use, prefer to use ``proxy`` if they are the same.
            format: ``{"http": proxy_url, "https": proxy_url}``.
        proxy: proxy to use, format: "http://user@pass:proxy_url".
            Can't be used with `proxies` parameter.
        proxy_auth: HTTP basic auth for proxy, a tuple of (username, password).
        verify: whether to verify https certs.
        referer: shortcut for setting referer header.
        accept_encoding: shortcut for setting accept-encoding header.
        content_callback: a callback function to receive response body.
            ``def callback(chunk: bytes) -> None:``
        impersonate: which browser version or fingerprint to impersonate.
        ja3: ja3 string to impersonate.
        akamai: akamai string to impersonate.
        extra_fp: extra fingerprints options, in complement to ja3 and akamai strings.
        thread: thread engine to use for working with other thread implementations.
            choices: eventlet, gevent.
        default_headers: whether to set default browser headers when impersonating.
        default_encoding: encoding for decoding response content if charset is not found
            in headers. Defaults to "utf-8". Can be set to a callable for automatic
            detection.
        quote: Set characters to be quoted, i.e. percent-encoded. Default safe string
            is ``!#$%&'()*+,/:;=?@[]~``. If set to a sting, the character will be
            removed from the safe string, thus quoted. If set to False, the url will be
            kept as is, without any automatic percent-encoding, you must encode the URL
            yourself.
        curl_options: extra curl options to use.
        http_version: limiting http version, defaults to http2.
        debug: print extra curl debug info.
        interface: interface name or local IP to bind to (bare IP = source address).
        cert: a tuple of (cert, key) filenames for client cert.
        stream: streaming the response, default False.
        max_recv_speed: maximum receive speed, bytes per second.
        multipart: upload files using the multipart format, see examples for details.
        discard_cookies: discard cookies from server. Default to False.

    Returns:
        A ``Response`` object.
    NF)r,   r-   r.   ©r8   r9   r5   )r   r   )r8   r9   r,   r-   r.   r:   Úsr5   r5   r6   r   L   s   C$ÿr   c                 K   ó   t dd| dœ|¤ŽS )NÚHEADr<   r5   ©r   ©r9   r:   r5   r5   r6   r   ”   ó   r   c                 K   r>   )NÚGETr<   r5   r@   rA   r5   r5   r6   r   ˜   rB   r   c                 K   r>   )NÚPOSTr<   r5   r@   rA   r5   r5   r6   r	   œ   rB   r	   c                 K   r>   )NÚPUTr<   r5   r@   rA   r5   r5   r6   r
       rB   r
   c                 K   r>   )NÚPATCHr<   r5   r@   rA   r5   r5   r6   r   ¤   rB   r   c                 K   r>   )NÚDELETEr<   r5   r@   rA   r5   r5   r6   r   ¨   rB   r   c                 K   r>   )NÚOPTIONSr<   r5   r@   rA   r5   r5   r6   r   ¬   rB   r   c                 K   r>   )NÚTRACEr<   r5   r@   rA   r5   r5   r6   Útrace°   rB   rJ   c                 K   r>   )NÚQUERYr<   r5   r@   rA   r5   r5   r6   Úquery´   rB   rL   )NNN)8Ú__all__Útypingr"   r#   r$   Úconstr   Úcacher   r   Úcookiesr   r   Úerrorsr   Úheadersr   r   Úimpersonater   r   r   Úmodelsr   r   Úsessionr   r'   r    r   r   r(   r)   r*   Ú
websocketsr   r   r   r   r   r   r   r+   Ústrr3   r4   r   r   r   r	   r
   r   r   r   rJ   rL   r5   r5   r5   r6   Ú<module>   sR    #($

ûÿþýüûú
ùH