HSL 2.0 framework
Description of the framework
Public Member Functions |List of all members
hsl20_4_http_client.hsl20_4_http_client.Response Class Reference

HTTP Client Response. More

..

Public Member Functions

def__init__ (self, stream)
Constructor. More...
defget_http_version (self)
Returns the version string of the request (e.g. HTTP/1.1) More...
defget_status_code (self)
Returns the HTTP status code of the request (e.g.: 200) More...
defget_status_text (self)
Returns the HTTP status text of the request (e.g.: OK) More...
defget_headers (self)
Returns the headers transmitted by the remote terminal as a dictionary. More...
defget_header (self, key)
Returns the value of a header entry. More...
defget_body (self)
Returns the body part of the response. More...

Detailed Description

HTTP client response

Deprecated:
This class should no longer be used. The example https_client WebRequest shows how it can be replaced by standard Python modules.

In this class all parameters are encapsulated, which the remote station has answered to the request

From version 2.0.3:
Class is deprecated
Added reference to the new example

Constructor & Destructor Documentation

◆ __init__()

def hsl20_4_http_client.hsl20_4_http_client.Response.__init__ ( self,
stream
)

Constructor

Warning
This class should not be instantiated directly

Member Function Documentation

◆ get_body()

def hsl20_4_http_client.hsl20_4_http_client.Response.get_body ( self)

Returns the body part of the response

Returns
string
Body

◆ get_header()

def hsl20_4_http_client.hsl20_4_http_client.Response.get_header ( self,
key
)

Returns the value of a header entry

Parameters
keystring
Key
Returns
string
Value. Returns None, if an invalid key was passed

◆ get_headers()

def hsl20_4_http_client.hsl20_4_http_client.Response.get_headers ( self)

Returns the headers transmitted by the remote terminal as a dictionary

Note
To be observed: The keys will be returned completely in lower case!
Returns
dictionary
All headers in the form of a dictionary

◆ get_http_version()

def hsl20_4_http_client.hsl20_4_http_client.Response.get_http_version ( self)

Returns the version string of the request (e.g.: HTTP/1.1)

Returns
string
Protocol version. Returns None if the server did not respond in HTTP compliant mode

◆ get_status_code()

def hsl20_4_http_client.hsl20_4_http_client.Response.get_status_code ( self)

Returns the HTTP status code of the request (e.g.: 200)

Returns
int
HTTP status code. Returns 0, if the server did not respond in accordance with HTTP

◆ get_status_text()

def hsl20_4_http_client.hsl20_4_http_client.Response.get_status_text ( self)

Returns the HTTP status text of the request (e.g.: OK)

Returns
string
Status text. Returns "" if the server has not responded in accordance with HTTP

The documentation for this class was generated from the following file: