xj9ddlmZddlZddlmZddlmZddlmZddl m Z m Z m Z m Z mZddlmZdd lmZmZmZmZmZmZmZmZmZdd lmZej:r ddlZdd lm Z gd Z!ddddddddded ddd ddZ"eddddddddded ddd d dZ#dddddd dedd d!dZ$dddddd dedd d!dZ%dddddd dedd d!dZ&dddddddddd dedd d"dZ'dddddddddd dedd d"dZ(dddddddddd dedd d"dZ)dddddd eddd d#dZ*dddddddddd dedd d"dZ+edddddd eddde e e e d d$dZ,y)%) annotationsN) Generator)contextmanager)Client)'DEFAULT_KEEPALIVE_PING_INTERVAL_SECONDS&DEFAULT_KEEPALIVE_PING_TIMEOUT_SECONDSDEFAULT_MAX_MESSAGE_SIZE_BYTESDEFAULT_QUEUE_SIZEDEFAULT_TIMEOUT_CONFIG)Response) AuthTypes CookieTypes HeaderTypes ProxyTypesQueryParamTypesRequestContent RequestData RequestFiles TimeoutTypes)URL)WebSocketSession) deletegetheadoptionspatchpostputqueryrequeststream websocketFT) paramscontentdatafilesjsonheaderscookiesauthproxytimeoutfollow_redirectsverify trust_envc t|| | | |5}|j||||||||| |  cdddS#1swYyxYw)aSends 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 ``` r*r,r/r-r0 methodurlr%r&r'r(r$r)r+r.N)rr!)r4r5r$r%r&r'r(r)r*r+r,r-r.r/r0clients _/mnt/ssd/data/Dropbox/adrian/sandbox/mcp-query/venv/lib/python3.12/site-packages/httpx2/_api.pyr!r!2sef    ~~-     s6?c #Kt|| | | |5}|j||||||||| |  5}|ddddddy#1swYxYw#1swYyxYww)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#streaming-responses r2r3N)rr")r4r5r$r%r&r'r(r)r*r+r,r-r.r/r0r6responses r7r"r"zs:     ]]-  N   1AAAA AA AAA r$r)r*r+r,r.r/r-r0c .td||||||||||  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! r5r$r)r*r+r,r.r/r-r0s r7rrs2*    )  c .td||||||||||  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 r7rrs2*   )  r@c .td||||||||||  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 r7rrs2*   )  r@ r%r&r'r(r$r)r*r+r,r.r/r-r0c 6td|||||||||| | | | | S)zL Sends a `POST` request. **Parameters**: See `httpx2.request`. POSTrEr>r5r%r&r'r(r$r)r*r+r,r.r/r-r0s r7rrs>,     ) r@c 6td|||||||||| | | | | S)zK Sends a `PUT` request. **Parameters**: See `httpx2.request`. PUTrEr>rHs r7rrBs>,      ) r@c 6td|||||||||| | | | | S)zM Sends a `PATCH` request. **Parameters**: See `httpx2.request`. PATCHrEr>rHs r7rrk>,     ) r@) r$r)r*r+r,r.r-r/r0c .td||||||||||  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>) r5r$r)r*r+r,r.r-r/r0s r7rrs2*   )  r@c 6td|||||||||| | | | | S)zM Sends a `QUERY` request. **Parameters**: See `httpx2.request`. QUERYrEr>rHs r7r r rMr@)r$r)r*r+r,r.r-r/r0 subprotocolsmax_message_size_bytes queue_sizekeepalive_ping_interval_secondskeepalive_ping_timeout_secondsc #Kt||||| 5}|j|||||| | | | | 5}|ddddddy#1swYxYw#1swYyxYww)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.rRrSrTrUrVN)rr#)r5r$r)r*r+r,r.r-r/r0rRrSrTrUrVr6sessions r7r#r#s@        -%#9!,K+I  M   r:) r4strr5 URL | strr$QueryParamTypes | Noner%RequestContent | Noner&RequestData | Noner'RequestFiles | Noner(typing.Any | Noner)HeaderTypes | Noner*CookieTypes | Noner+AuthTypes | Noner,ProxyTypes | Noner-rr.boolr/ssl.SSLContext | str | boolr0rdreturnr ) r4rYr5rZr$r[r%r\r&r]r'r^r(r_r)r`r*rar+rbr,rcr-rr.rdr/rer0rdrfzGenerator[Response])r5rZr$r[r)r`r*rar+rbr,rcr.rdr/rer-rr0rdrfr )r5rZr%r\r&r]r'r^r(r_r$r[r)r`r*rar+rbr,rcr.rdr/rer-rr0rdrfr )r5rZr$r[r)r`r*rar+rbr,rcr.rdr-rr/rer0rdrfr ) r5rZr$r[r)r`r*rar+rbr,rcr.rdr-rr/rer0rdrRzlist[str] | NonerSintrTrgrU float | NonerVrhrfzGenerator[WebSocketSession])- __future__rtypingcollections.abcr contextlibr_clientr_configrr r r r _modelsr _typesrrrrrrrrr_urlsr TYPE_CHECKINGsslwebsockets._apir__all__r!r"rrrrrrrr r#r@r7rws)" %%    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 222 (22#2 22&22 %1!2"!#22r@