�
�MMg�- � � � d dl mZ d dlZd dlmZ ddlmZ ddlmZ ddl m
Z
ddlmZm
Z
mZmZmZmZmZmZmZ dd lmZ ej. rd dlZg d
�Zdddddddddedddd
�
dd�Zedddddddddedddd
�
dd�� Zdddddddedd� dd�Zdddddddedd� dd�Zdddddddedd� dd�Zdddddddddddedd�
dd�Zdddddddddddedd�
dd�Z dddddddddddedd�
dd�Z!ddddddeddd� dd�Z"y)� )�annotationsN)�contextmanager� )�Client)�DEFAULT_TIMEOUT_CONFIG)�Response) � AuthTypes�CookieTypes�HeaderTypes�
ProxyTypes�QueryParamTypes�RequestContent�RequestData�RequestFiles�TimeoutTypes)�URL) �delete�get�head�options�patch�post�put�request�streamFT)
�params�content�data�files�json�headers�cookies�auth�proxy�timeout�follow_redirects�verify� trust_envc
� � t ||
|
||�� 5 }|j | |||||||| |��
cddd� S # 1 sw Y yxY w)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
<Response [200 OK]>
```
�r"