
    Xh5                        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 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 ddlmZm Z m!Z!m"Z"m#Z#m$Z$ er G d de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Z)de&dee%   fdZ*de&dee%   fdZ+de&dee%   fdZ,de&dee%   fdZ-de&dee%   fdZ.de&dee%   fdZ/de&dee%   fd Z0de&dee%   fd!Z1de&dee%   fd"Z2y)$)SessionAsyncSessionBrowserTypeBrowserTypeLiteral
CurlWsFlagrequestheadgetpostputpatchdeleteoptionsRequestsErrorCookiesHeadersRequestResponseAsyncWebSocket	WebSocketWebSocketErrorWebSocketClosedWebSocketTimeoutWsCloseCodeExtraFingerprintsCookieTypesHeaderTypes	ProxySpec    )OptionalTYPE_CHECKING	TypedDict   )r      )r   r   )r   )r   r   )r   r   r   )r   r   )r   
HttpMethodr   r   
ThreadTypeRequestParamsUnpack)r   r   r   r   r   r   c                   >    e Zd ZU ee   ed<   ee   ed<   ee   ed<   y)SessionRequestParamsthreadcurl_optionsdebugN)__name__
__module____qualname__r   r%   __annotations__dictbool     S/home/Script/Script_env/lib/python3.12/site-packages/curl_cffi/requests/__init__.pyr)   r)   <   s!    $$tn$~r4   r)   F)totalNmethodurlr*   r+   r,   kwargsreturnc                     |dn|}t        |||      5 } |j                  d| |d|cddd       S # 1 sw Y   yxY w)aP  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.
        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 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: which interface to use.
        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,   r7   r8   r3   )r   r   )r7   r8   r*   r+   r,   r9   ss          r5   r   r   D   sK    B ]EE	\	G ;1qyy:C:6:; ; ;s   4=c                     t        dd| d|S )NHEADr<   r3   r   r8   r9   s     r5   r   r          4&c4V44r4   c                     t        dd| d|S )NGETr<   r3   r@   rA   s     r5   r	   r	          3%S3F33r4   c                     t        dd| d|S )NPOSTr<   r3   r@   rA   s     r5   r
   r
      rB   r4   c                     t        dd| d|S )NPUTr<   r3   r@   rA   s     r5   r   r      rE   r4   c                     t        dd| d|S )NPATCHr<   r3   r@   rA   s     r5   r   r          5's5f55r4   c                     t        dd| d|S )NDELETEr<   r3   r@   rA   s     r5   r   r      s    6(6v66r4   c                     t        dd| d|S )NOPTIONSr<   r3   r@   rA   s     r5   r   r      s    7)777r4   c                     t        dd| d|S )NTRACEr<   r3   r@   rA   s     r5   tracerS      rL   r4   c                     t        dd| d|S )NQUERYr<   r3   r@   rA   s     r5   queryrV      rL   r4   )NNN)3__all__typingr   r    r!   constr   cookiesr   r   errorsr   headersr   r   impersonater   r   r   modelsr   r   sessionr   r$   r   r   r%   r&   r'   
websocketsr   r   r   r   r   r   r)   strr1   r2   r   r   r	   r
   r   r   r   r   rS   rV   r3   r4   r5   <module>rb      s  > 6 5  ) ! ) K K %    }E 
 % $(#' C;C;	C; Z C; 4.	C;
 D>C; ]#C; C;L5c 5V$89 54S 4F#78 45c 5V$89 54S 4F#78 46s 6f%9: 67 7v&:; 78 8'; < 86s 6f%9: 66s 6f%9: 6r4   