Open Lighting Architecture 0.10.9
Loading...
Searching...
No Matches
ola::http Namespace Reference

Detailed Description

The embedded HTTP server.

Classes

class  auto_ptr
 STL class. More...
 
class  ExportMap
 A container for the exported variables. More...
 
class  HTTPRequest
 
class  HTTPResponse
 
class  HTTPServer
 The base HTTP Server. More...
 
class  ifstream
 STL class. More...
 
class  JsonValue
 The base class for JSON values. More...
 
class  JsonWriter
 A class to serialize a JSONValue to text. More...
 
class  map
 STL class. More...
 
class  OlaHTTPServer
 
class  ostringstream
 STL class. More...
 
class  pair
 STL class. More...
 
class  set
 STL class. More...
 
class  string
 STL class. More...
 
class  UnmanagedFileDescriptor
 Allows a FD created by a library to be used with the SelectServer. More...
 
class  vector
 STL class. More...
 

Functions

static MHD_RESULT AddHeaders (void *cls, enum MHD_ValueKind kind, const char *key, const char *value)
 Called by MHD_get_connection_values to add headers to a request object.
 
MHD_RESULT IteratePost (void *request_cls, enum MHD_ValueKind kind, const char *key, const char *filename, const char *content_type, const char *transfer_encoding, const char *data, uint64_t off, size_t size)
 Called by MHD_create_post_processor to iterate over the post form data.
 
static MHD_RESULT HandleRequest (void *http_server_ptr, struct MHD_Connection *connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **ptr)
 Called whenever a new request is made.
 
void RequestCompleted (void *, struct MHD_Connection *, void **request_cls, enum MHD_RequestTerminationCode)
 Called when a request completes.
 

Function Documentation

◆ AddHeaders()

static MHD_RESULT ola::http::AddHeaders ( void * cls,
enum MHD_ValueKind kind,
const char * key,
const char * value )
static

Called by MHD_get_connection_values to add headers to a request object.

Parameters
clsa pointer to an HTTPRequest object.
kindthe source of the key-value pair
keythe header name
valuethe header value

◆ HandleRequest()

static MHD_RESULT ola::http::HandleRequest ( void * http_server_ptr,
struct MHD_Connection * connection,
const char * url,
const char * method,
const char * version,
const char * upload_data,
size_t * upload_data_size,
void ** ptr )
static

Called whenever a new request is made.

This sets up HTTPRequest & HTTPResponse objects and then calls DispatchRequest.

◆ IteratePost()

MHD_RESULT ola::http::IteratePost ( void * request_cls,
enum MHD_ValueKind kind,
const char * key,
const char * filename,
const char * content_type,
const char * transfer_encoding,
const char * data,
uint64_t off,
size_t size )

Called by MHD_create_post_processor to iterate over the post form data.

Parameters
request_clsa pointer to a HTTPRequest object
kindthe source of the key-value pair
keythe header name
filenamethe name of the uploaded file or NULL if unknown
content_typethe MIME type of the data or NULL if unknown
transfer_encodingthe encoding of the data or NULL if unknown
datathe header value
offthe offset of the data
sizethe number of bytes available

◆ RequestCompleted()

void ola::http::RequestCompleted ( void * ,
struct MHD_Connection * ,
void ** request_cls,
enum MHD_RequestTerminationCode )

Called when a request completes.

This deletes the associated HTTPRequest object.