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

HTTP response. More..

Public Member Functions

def__init__ (self)
Constructor. More...
defset_status_code (self, code, text=None)
Sets the status code and optionally the status text. More...
defset_header (self, key, value)
Sets a header. More...
defset_body (self, data)
Sets the body of the answer. More...

Private Member Functions

def_clear (self)
Removes all references

Detailed Description

HTTP Response

Deprecated:
This class should no longer be used.

This encapsulates all parameters that the HTTP server replies to the remote terminal. For details on the procedure and use of this class, refer to HTTP Server

Constructor & Destructor Documentation

◆ __init__()

def hsl20_4_http_server.hsl20_4_http_server.Response.__init__ ( self)

Constructor

Warning
This class should not be instantiated directly

Member Function Documentation

◆ set_body()

def hsl20_4_http_server.hsl20_4_http_server.Response.set_body ( self,
data
)

Sets the body of the answer

The data assigned here is the actual response to the query

Parameters
datastring
Data

◆ set_header()

def hsl20_4_http_server.hsl20_4_http_server.Response.set_header ( self,
key,
value
)

Sets a header

Parameters
keystring
Key
valuestring
Value

◆ set_status_code()

def hsl20_4_http_server.hsl20_4_http_server.Response.set_status_code ( self,
code,
text = None
)

Sets the status code and optionally the status text

If no code is set, the server responds with code 500 (Internal Server Error)

Parameters
codeint
Code (e.g. 200)
textstring
Text (e.g. OK)

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