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.Request Class Reference

HTTP Requests. More

..

## Public Member Functions
def | __init__ (self)
| Constructor. More...
def | get_method (self)
| Returns the retrieval method. More...
def | get_path (self)
| Returns the complete path of the query without the query part. More...
def | get_fullpath (self)
| Returns the complete path of the query including the query part. More...
def | get_http_version (self)
| Returns the HTTP version of the retrieval. More...
def | get_query (self)
| Returns all parameters from the query part of the query in the form of a dictionary. More...
def | get_query_string (self)
| Returns the entire query string of the query. More...
def | get_header (self, key)
| Returns the value of a header entry. More...
def | get_headers (self)
| Returns the headers transmitted by the remote peer as dictionary. More...
def | get_body (self)
| Returns the body of the HTTP request. More...

## Private Member Functions
def | _set_info (self, method, path, version)
| Sets the HTTP information
def | _set_header (self, header)
| Sets the headers
def | _set_body (self, body)
| Sets the request body
def | _clear (self)
| Removes all references

## Detailed Description

HTTP requests

This class encapsulates all parameters that the HTTP request has left with the server. For more information about the flow and use of this class, see HTTP Server

## Constructor & Destructor Documentation

## ◆ __init__()

def hsl20_4_http_server.hsl20_4_http_server.Request.__init__ | ( |  | self | ) |

Constructor

Warning
  This class should not be instantiated directly

## Member Function Documentation

## ◆ get_body()

def hsl20_4_http_server.hsl20_4_http_server.Request.get_body | ( |  | self | ) |

Returns the body of the HTTP request

Returns
  string
  Dates. Returns None if the query does not contain a body element

## ◆ get_fullpath()

def hsl20_4_http_server.hsl20_4_http_server.Request.get_fullpath | ( |  | self | ) |

Returns the complete path of the query including the query part

Returns
  string
  Path

## ◆ get_header()

def hsl20_4_http_server.hsl20_4_http_server.Request.get_header | ( |  | self,
|  |  | key
| ) |  |

Returns the value of a header entry

Parameters

  key | string Key

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

## ◆ get_headers()

def hsl20_4_http_server.hsl20_4_http_server.Request.get_headers | ( |  | self | ) |

Returns the headers transmitted by the remote peer as 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_server.hsl20_4_http_server.Request.get_http_version | ( |  | self | ) |

Returns the HTTP version of the retrieval

Returns
  string
  Version (e.g. HTTP\1.0)

## ◆ get_method()

def hsl20_4_http_server.hsl20_4_http_server.Request.get_method | ( |  | self | ) |

Returns the retrieval method

Returns
  string
  Retrieval method

## ◆ get_path()

def hsl20_4_http_server.hsl20_4_http_server.Request.get_path | ( |  | self | ) |

Returns the complete path of the query without the query part

Returns
  string
  Path

## ◆ get_query()

def hsl20_4_http_server.hsl20_4_http_server.Request.get_query | ( |  | self | ) |

Returns all parameters from the query part of the query in the form of a dictionary

The values are already decoded

Returns
  dictionary
  Parameters

## ◆ get_query_string()

def hsl20_4_http_server.hsl20_4_http_server.Request.get_query_string | ( |  | self | ) |

Returns the entire query string of the query

Returns
  string
  Query string

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

- hsl20_4_http_server.py