| Server IP : 43.129.54.214 / Your IP : 216.73.217.113 Web Server : nginx/1.24.0 System : Linux VM-4-108-ubuntu 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.3.6 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/local/qcloud/python/lib/python3.7/http/__pycache__/ |
Upload File : |
B
��f#� � @ sb d Z ddlZddlZddlZddlZddlZddlZddlZ ddl
mZ dddddd d
ddd
ddddddddgZdZ
dZdZdZdZdZe� �ejj� dd� ejj�� D �ZdZdZd Ze�d!�jZe�d"�jZ e�d#�Z!e�d$�Z"d%d&d'hZ#dAd)d*�Z$G d+d,� d,ej%j&�Z'e'fd-d.�Z(G d/d� dej)�Z*G d0d� d�Z+yddl,Z,W n e-k
�r\ Y nX G d1d2� d2e+�Z.e�/d2� G d3d� de0�Z1G d4d� de1�Z2G d5d� de1�Z3G d6d� de1�Z4G d7d � d e1�Z5G d8d
� d
e1�Z6G d9d� de1�Z7G d:d
� d
e1�Z8G d;d� de8�Z9G d<d� de8�Z:G d=d� de8�Z;G d>d� de1�Z<G d?d� de1�Z=G d@d� de>e<�Z?e1Z@dS )Ba�
HTTP/1.1 client library
<intro stuff goes here>
<other stuff, too>
HTTPConnection goes through a number of "states", which define when a client
may legally make another request or fetch the response for a particular
request. This diagram details these state transitions:
(null)
|
| HTTPConnection()
v
Idle
|
| putrequest()
v
Request-started
|
| ( putheader() )* endheaders()
v
Request-sent
|\_____________________________
| | getresponse() raises
| response = getresponse() | ConnectionError
v v
Unread-response Idle
[Response-headers-read]
|\____________________
| |
| response.read() | putrequest()
v v
Idle Req-started-unread-response
______/|
/ |
response.read() | | ( putheader() )* endheaders()
v v
Request-started Req-sent-unread-response
|
| response.read()
v
Request-sent
This diagram presents the following rules:
-- a second request may not be started until {response-headers-read}
-- a response [object] cannot be retrieved until {request-sent}
-- there is no differentiation between an unread response body and a
partially read response body
Note: this enforcement is applied by the HTTPConnection class. The
HTTPResponse class does not enforce this state machine, which
implies sophisticated clients may accelerate the request/response
pipeline. Caution should be taken, though: accelerating the states
beyond the above pattern may imply knowledge of the server's
connection-close behavior for certain requests. For example, it
is impossible to tell whether the server will close the connection
UNTIL the response headers have been read; this means that further
requests cannot be placed into the pipeline until it is known that
the server will NOT be closing the connection.
Logical State __state __response
------------- ------- ----------
Idle _CS_IDLE None
Request-started _CS_REQ_STARTED None
Request-sent _CS_REQ_SENT None
Unread-response _CS_IDLE <response_class>
Req-started-unread-response _CS_REQ_STARTED <response_class>
Req-sent-unread-response _CS_REQ_SENT <response_class>
� N)�urlsplit�HTTPResponse�HTTPConnection�
HTTPException�NotConnected�UnknownProtocol�UnknownTransferEncoding�UnimplementedFileMode�IncompleteRead�
InvalidURL�ImproperConnectionState�CannotSendRequest�CannotSendHeader�ResponseNotReady�
BadStatusLine�LineTooLong�RemoteDisconnected�error� responses�P i� ZUNKNOWNZIdlezRequest-startedzRequest-sentc C s i | ]}|j |�qS � )�phrase)�.0�vr r �5/usr/local/qcloud/python/lib/python3.7/http/client.py�
<dictcomp>j s r i i �d s [^:\s][^:\r\n]*s \n(?![ \t])|\r(?![ \t\n])z[ - ]z[ -]ZPATCHZPOSTZPUT�datac
C sf y
| � d�S tk
r` } z8t|j|j|j|jd|�� | |j|j� |f �d�W dd}~X Y nX dS )z<Call data.encode("latin-1") but show a better error message.zlatin-1z`%s (%.20r) is not valid Latin-1. Use %s.encode('utf-8') if you want to send it encoded in UTF-8.N)�encode�UnicodeEncodeError�encoding�object�start�end�title)r �name�errr r r �_encode� s
r'