o
    óT·jp  ã                   @  s~   d dl mZ d dlZd dlZd dlmZ ddlmZmZm	Z	m
Z
 ddlmZ ddddœddd„Zejddddœddd„ƒZdS )é    )ÚannotationsN)Ú	Generatoré   )ÚURLÚ
ExtensionsÚHeaderTypesÚResponse)ÚConnectionPool)ÚheadersÚcontentÚ
extensionsÚmethodúbytes | strÚurlúURL | bytes | strr
   r   r   ú%bytes | typing.Iterator[bytes] | Noner   úExtensions | NoneÚreturnr   c                C  s>   t ƒ �}|j| ||||d�W  d  ƒ S 1 sw   Y  dS )aW  
    Sends an HTTP request, returning the response.

    ```
    response = httpcore2.request("GET", "https://www.example.com/")
    ```

    Arguments:
        method: The HTTP method for the request. Typically one of `"GET"`,
            `"OPTIONS"`, `"HEAD"`, `"POST"`, `"PUT"`, `"PATCH"`, or `"DELETE"`.
        url: The URL of the HTTP request. Either as an instance of `httpcore2.URL`,
            or as str/bytes.
        headers: The HTTP request headers. Either as a dictionary of str/bytes,
            or as a list of two-tuples of str/bytes.
        content: The content of the request body. Either as bytes,
            or as a bytes iterator.
        extensions: A dictionary of optional extra information included on the request.
            Possible keys include `"timeout"`.

    Returns:
        An instance of `httpcore2.Response`.
    ©r   r   r
   r   r   N)r	   Úrequest)r   r   r
   r   r   Úpool© r   úQ/home/dinkstrade/pdmp-scanner/venv/lib/python3.10/site-packages/httpcore2/_api.pyr      s   û$ÿr   úGenerator[Response]c             	   c  sx   � t ƒ �.}|j| ||||d��}|V  W d  ƒ n1 sw   Y  W d  ƒ dS W d  ƒ dS 1 s5w   Y  dS )ar  
    Sends an HTTP request, returning the response within a content manager.

    ```
    with httpcore2.stream("GET", "https://www.example.com/") as response:
        ...
    ```

    When using the `stream()` function, the body of the response will not be
    automatically read. If you want to access the response body you should
    either use `content = response.read()`, or `for chunk in response.iter_content()`.

    Arguments:
        method: The HTTP method for the request. Typically one of `"GET"`,
            `"OPTIONS"`, `"HEAD"`, `"POST"`, `"PUT"`, `"PATCH"`, or `"DELETE"`.
        url: The URL of the HTTP request. Either as an instance of `httpcore2.URL`,
            or as str/bytes.
        headers: The HTTP request headers. Either as a dictionary of str/bytes,
            or as a list of two-tuples of str/bytes.
        content: The content of the request body. Either as bytes,
            or as a bytes iterator.
        extensions: A dictionary of optional extra information included on the request.
            Possible keys include `"timeout"`.

    Returns:
        An instance of `httpcore2.Response`.
    r   N)r	   Ústream)r   r   r
   r   r   r   Úresponser   r   r   r   3   s   €$ûùÿ"ÿr   )r   r   r   r   r
   r   r   r   r   r   r   r   )r   r   r   r   r
   r   r   r   r   r   r   r   )Ú
__future__r   Ú
contextlibÚtypingÚcollections.abcr   Ú_modelsr   r   r   r   Ú_sync.connection_poolr	   r   Úcontextmanagerr   r   r   r   r   Ú<module>   s    ú(ú