xL i-ddlmZddlZddlmZddlmZddlmZddl m Z ddl m Z m Z mZmZmZmZmZmZmZdd lmZej.rddlZgd Zddddddddded d d d ddZeddddddddded d d d ddZdddddd d ed d ddZdddddd d ed d ddZdddddd d ed d ddZdddddddddd d ed d ddZdddddddddd d ed d ddZ dddddddddd d ed d ddZ!dddddd ed d d ddZ"y)) annotationsN)contextmanager)Client)DEFAULT_TIMEOUT_CONFIG)Response) AuthTypes CookieTypes HeaderTypes ProxyTypesQueryParamTypesRequestContent RequestData RequestFiles TimeoutTypes)URL) deletegetheadoptionspatchpostputrequeststreamFT) paramscontentdatafilesjsonheaderscookiesauthproxytimeoutfollow_redirectsverify trust_envc t|| | | |5}|j||||||||| |  cdddS#1swYyxYw)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. * **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:** `Response` Usage: ``` >>> import httpx >>> response = httpx.request('GET', 'https://httpbin.org/get') >>> response ``` r"r$r'r%r( methodurlrrrr rr!r#r&N)rr)r,r-rrrrr r!r"r#r$r%r&r'r(clients P/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/httpx/_api.pyrr'se~    ~~-     s6?c #Kt|| | | |5}|j||||||||| |  5}|ddddddy#1swYxYw#1swYyxYww)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)rr)r,r-rrrrr r!r"r#r$r%r&r'r(r.responses r/rr{s:     ]]-  N   s1AAAA AA AAA rr!r"r#r$r&r'r%r(c .td||||||||||  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. GETr2r r-rr!r"r#r$r&r'r%r(s r/rrs2*    )  c .td||||||||||  S)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. OPTIONSr2r5r6s r/rrs2*   )  r7c .td||||||||||  S)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. HEADr2r5r6s r/rrs2*   )  r7 rrrr rr!r"r#r$r&r'r%r(c 6td|||||||||| | | | | S)zK Sends a `POST` request. **Parameters**: See `httpx.request`. POSTr<r5r-rrrr rr!r"r#r$r&r'r%r(s r/rrs>,     ) r7c 6td|||||||||| | | | | S)zJ Sends a `PUT` request. **Parameters**: See `httpx.request`. PUTr<r5r?s r/rrCs>,      ) r7c 6td|||||||||| | | | | S)zL Sends a `PATCH` request. **Parameters**: See `httpx.request`. PATCHr<r5r?s r/rrls>,     ) r7) rr!r"r#r$r&r%r'r(c .td||||||||||  S)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. DELETEr2r5) r-rr!r"r#r$r&r%r'r(s r/rrs2*   )  r7) r,strr- URL | strrQueryParamTypes | NonerRequestContent | NonerRequestData | NonerRequestFiles | Noner typing.Any | Noner!HeaderTypes | Noner"CookieTypes | Noner#AuthTypes | Noner$ProxyTypes | Noner%rr&boolr'ssl.SSLContext | str | boolr(rQreturnr) r,rFr-rGrrHrrIrrJrrKr rLr!rMr"rNr#rOr$rPr%rr&rQr'rRr(rQrSztyping.Iterator[Response])r-rGrrHr!rMr"rNr#rOr$rPr&rQr'rRr%rr(rQrSr)r-rGrrIrrJrrKr rLrrHr!rMr"rNr#rOr$rPr&rQr'rRr%rr(rQrSr)r-rGrrHr!rMr"rNr#rOr$rPr&rQr%rr'rRr(rQrSr)# __future__rtyping contextlibr_clientr_configr_modelsr_typesr r r r r rrrr_urlsr TYPE_CHECKINGssl__all__rrrrrrrrrr7r/r`sx" %+     "&*%)#!%""&"&!#2"*.!Q Q Q  # Q # Q  Q  Q  Q  Q  Q  Q  Q Q Q  (Q !Q "#Q h &*%)#!%""&"&!#2"*.!/ / / # / # /  / / / / / / /// (/ !/"#//j&*"&"&!#"*.2! ! #! !  !  ! !! (!!!!N&*"&"&!#"*.2! ! #! !  !  ! !! (!!!!N&*"&"&!#"*.2! ! #! !  !  ! !! (!!!!N&*#!%"%)"&"&!#"*.2& &#&  &  &  & #& & & & && (&&& !&X&*#!%"%)"&"&!#"*.2& &#&  &  &  & #& & & & && (&&& !&X&*#!%"%)"&"&!#"*.2& &#&  &  &  & #& & & & && (&&& !&X&*"&"&!#"2*.! ! #! !  !  ! !!! (!!!r7