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...
def | set_status_code (self, code, text=None)
| Sets the status code and optionally the status text. More...
def | set_header (self, key, value)
| Sets a header. More...
def | set_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

  data | string Data

## ◆ set_header()

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

Sets a header

Parameters

  key | string Key
  value | string 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

  code | int Code (e.g. 200)
  text | string Text (e.g. OK)

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

- hsl20_4_http_server.py