David Fletcher / Mbed 2 deprecated CC3000WebServer

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Dynamic request handler module

Dynamic request handler module

This module implements dynamic content processing for HTTP requests. More...

Functions

int HttpDynamic_InitRequest (uint16 uConnection, struct HttpBlob resource)
 Initialize HttpDynamic module state for a new request, and identify the request This function must examine the specified resource string and determine whether it can commit to process this request Also, if the resource string includes any information that this module needs in order to process the request (such as the contents of the query string) then it is the responsibility of this function to parse this information and store it in a connection-specific struct.
void HttpDynamic_ProcessRequest (struct HttpRequest *request)
 Process a dynamic-content HTTP request This function is only be called by the core, if HttpDynamic_InitRequest() returns nonzero.

Detailed Description

This module implements dynamic content processing for HTTP requests.

All requests are handled by C code functions, and the response contents is returned via HttpResopnse routines Note this module is only compiled if HTTP_CORE_ENABLE_DYNAMIC is defined in HttpConfig.h


Function Documentation

int HttpDynamic_InitRequest ( uint16  uConnection,
struct HttpBlob  resource 
)

Initialize HttpDynamic module state for a new request, and identify the request This function must examine the specified resource string and determine whether it can commit to process this request Also, if the resource string includes any information that this module needs in order to process the request (such as the contents of the query string) then it is the responsibility of this function to parse this information and store it in a connection-specific struct.

If this function returns nonzero, then the core will call HttpDynamic_ProcessRequest() with the rest of the request details.

Parameters:
uConnectionThe number of the connection. This value is guaranteed to satisfy: 0 <= uConnection < HTTP_CORE_MAX_CONNECTIONS
resourceThe resource part of the URL, as specified by the browser in the request, including any query string (and hash) Note: The resource string exists ONLY during the call to this function. The string pointer should not be copied by this function.
Returns:
nonzero if request is to be handled by this module. zero if not.

Definition at line 80 of file HttpDynamic.cpp.

void HttpDynamic_ProcessRequest ( struct HttpRequest request )

Process a dynamic-content HTTP request This function is only be called by the core, if HttpDynamic_InitRequest() returns nonzero.

This function processes the specified HTTP request, and send the response on the connection specified by request->uConnection. This function must call the HttpResponse_*() functions in order to send data back to the browser. Please refer to HttpResponse.h for more information.

Parameters:
requestPointer to all data available about the request

Definition at line 187 of file HttpDynamic.cpp.