3 �ga�( � @ s� d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dl m Z mZmZ d dl mZmZ d dlZd dlZddlmZ ddlmZ dd lmZ dd lmZ ddlmZ ddlmZmZ dd lm Z m!Z!m"Z" ddl#m$Z$m%Z% ej&� de� �Z'dZ(e(� d�Z)de� �Z*d0e j+ee e,gdf eeej-ej.f d�dd�Z/edd� �Z0d1e1e2e2ej3d�dd�Z4e5d�dd�Z6eed�dd �Z7e j+ed!�d"d#�Z8e j+e5d!�d$d%�Z9e j+e5d!�d&d'�Z:dd(d)� fe j+ee5d*�d+d,�Z;e2e2e2d-�d.d/�Z<dS )2� N)�contextmanager)�Path)�Callable�Iterable�Union)�urlparse� urlunparse� )�__version__)�RequestHeadersDict)�UTF8)�plugin_manager)�get_httpie_session)�!AVAILABLE_SSL_VERSION_ARG_MAPPING�HTTPieHTTPSAdapter)�compress_request�prepare_request_body�#get_multipart_data_and_content_type)�get_expired_cookies� repr_dictz+application/x-www-form-urlencoded; charset=zapplication/jsonz, */*;q=0.5zHTTPie/)�args� config_dir�request_body_read_callback�returnc c s( d }d }| j s| jr<t|| j p"| j| jjd�| jd�}|j}t| ||d�}t| �}t| �}t | j | jt|d �d�}|r�|j |d � |j|_| jr�| jj| jjd�|_n|jr�|j|d<