PyDocs

Nav

Internet Protocols and Support

HTTPResponse

http.client

class (source) not WASI
  • HTTPResponse(sock, debuglevel=0, method=None, url=None)
Class whose instances are returned upon successful connection. Not instantiated directly by user.
Changed in 3.4
  • 3.4: The strict parameter was removed. HTTP 0.9 style “Simple Responses” are no longer supported.
Members of HTTPResponse

c

closed
Is True if the stream is closed.

d

debuglevel
A debugging hook.

f

fileno
Return underlying file descriptor if one exists.

g

getcode
Return the HTTP status code that was sent with the response, or None if the URL is not an HTTP URL.
getheader
Returns the value of the header matching *name*.
getheaders
Return list of (header, value) tuples.
geturl
Return the real URL of the page.

h

headers
Headers of the response in the form of an email.message.EmailMessage instance.

i

info
Returns an instance of the class mimetools.Message containing meta-information associated with the URL.

m

msg
A http.client.HTTPMessage instance containing the response headers.

r

read
Read and return the response body, or up to the next amt bytes.
readinto
Read up to len(b) bytes into bytearray b and return the number of bytes read.
reason
Reason phrase returned by server.

s

status
Status code returned by server.

u

url
URL of the resource retrieved, commonly used to determine if a redirect was followed.

v

version
HTTP protocol version used by server.
0 Examples
No examples for http.client/HTTPResponse.
See Also
No see-alsos for http.client/HTTPResponse
0 Notes
No notes for HTTPResponse