File: //home/arjun/.local/lib/python3.10/site-packages/httpx/__pycache__/_main.cpython-310.pyc
o
���g
= � @ s$ d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dl Zd dl
Zd dlZd dl
Zd dlZd dlZddlmZ ddlmZ ddlmZ ddlmZ ejrUd dlZd�d
d�Zd�dd�Zd�d�dd�Zd�d d!�Zd�d�d"d#�Zd�d$d%�Zd�d&d'�Z ej!ej!e"e"f d(f Z#ej!e#d(f Z$ej%e"ej&e"e$e#f f Z'd�d+d,�Z( d�d�d1d2�Z)d�d5d6�Z*d�d=d>�Z+d�d?d@�Z,d�dAdB�Z-ej.ddC�ej/dDe"dE�ej0dFdGdHe"dIdJ�ej0dKdLdMe"e"fdNdOdP�ej0dQdRdSe"dTdJ�ej0dUdVdWe"e"fdNdXdP�ej0dYdZd[e"ej1d\d]�fdNd^dP�ej0d_d`dae"e+dbdc�ej0dddede"e"fdNdfdP�ej0dgdhe"e"fdNdidP�ej0djdke"e"fdle,dmdn�ej0dodpe"ddqdr�ej0dsdte2dudvdr�ej0dwdxdNddydz�ej0d{d|dNdNd}dz�ej0d~de3dNddd��ej0d�e�1d��d�dJ�ej0d�d�e3dNdd�d��ej0d�dNdNde-d�d��d�d�d���������������������Z4dS )�� )�annotationsN� )�Client)�RequestError)�Response)�codes�return�Nonec C sT t j�� } | jddd� | �� | jddd� | �� | jddd� | �� t jjjddd �}|jd
dddd� |�d
� |�dd� |�dd� |�dd� |�dd� |�dd� |�dd� |�dd� |�dd� |�dd� |�d d!� |�d"d#� |�d$d%� |�d&d'� |�d(d)� |�d*d+� |�d,d-� |�d.d/� | �|� d S )0Nz[bold]HTTPX :butterfly:�center)�justifyzA next generation HTTP client.z7Usage: [bold]httpx[/bold] [cyan]<URL> [OPTIONS][/cyan] �leftr T)�padding�pad_edge� Parameter�bold)�no_wrapr �style�Descriptionz-m, --method [cyan]METHODz{Request method, such as GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD.
[Default: GET, or POST if a request body is included]z#-p, --params [cyan]<NAME VALUE> ...�/Query parameters to include in the request URL.z-c, --content [cyan]TEXT�,Byte content to include in the request body.z!-d, --data [cyan]<NAME VALUE> ...�)Form data to include in the request body.z%-f, --files [cyan]<NAME FILENAME> ...�*Form files to include in the request body.z-j, --json [cyan]TEXT�)JSON data to include in the request body.z$-h, --headers [cyan]<NAME VALUE> ...�/Include additional HTTP headers in the request.z --cookies [cyan]<NAME VALUE> ...�"Cookies to include in the request.z--auth [cyan]<USER PASS>��Username and password to include in the request. Specify '-' for the password to use a password prompt. Note that using --verbose/-v will expose the Authorization header, including the password encoding in a trivially reversible format.z--proxy [cyan]URL�ISend the request via a proxy. Should be the URL giving the proxy address.z--timeout [cyan]FLOAT�zTimeout value to use for network operations, such as establishing the connection, reading some data, etc... [Default: 5.0]�--follow-redirects�Automatically follow redirects.�--no-verify�Disable SSL verification.�--http2�@Send the request using HTTP/2, if the remote server supports it.z--download [cyan]FILE�?Save the response content as a file, rather than displaying it.z
-v, --verbosez1Verbose output. Show request as well as response.�--help�Show this message and exit.) �rich�console�Console�print�table�Table�grid�
add_column�add_row)r( r+ � r0 �>/home/arjun/.local/lib/python3.10/site-packages/httpx/_main.py�
print_help s|
�
������������r2 �responser �strc C s^ | j �d�}|d ur-|�d�\}}}zt�ttj�|� � �j
�W S tjjy, Y dS w dS )NzContent-Type�;� )
�headers�get� partition�typing�castr4 �pygments�lexers�get_lexer_for_mimetype�strip�name�util�
ClassNotFound)r3 �content_type� mime_type�_r0 r0 r1 �get_lexer_for_responseg s ��rF F�request�httpcore.Request�http2�boolc sh � rdnd}� fdd�| j D �}| j�d�}| jj�d�}|� d|� d|� �gdd� |D � }d�|�S ) NzHTTP/2zHTTP/1.1c s$ g | ]\}}� r|� � n||f�qS r0 )�lower��.0r@ �value�rI r0 r1 �
<listcomp>v s �z*format_request_headers.<locals>.<listcomp>�ascii� c S �* g | ]\}}|� d �� d|� d �� ��qS �rQ �: ��decoderL r0 r0 r1 rP { � ��
)r7 �methodrW �url�target�join)rG rI �versionr7 rZ r\ �linesr0 rO r1 �format_request_headerst s
��
r` �http_version�bytes�status�int�
reason_phrase�bytes | Noner7 �list[tuple[bytes, bytes]]c C sT | � d�}|d u rt�|�n|� d�}|� d|� d|� �gdd� |D � }d�|�S )NrQ rR c S rS rT rV rL r0 r0 r1 rP � rX z+format_response_headers.<locals>.<listcomp>rY )rW r �get_reason_phraser] )ra rc re r7 r^ �reasonr_ r0 r0 r1 �format_response_headers� s
���
rj c C sV t j�� }t| |d�}t jj|dddd�}|�|� t jjddddd�}|�|� d S )NrO �http� ansi_darkT��theme� word_wrapr6 )r'