|
Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
|
A persistent container object for HTTP parameters.
The parameters in an HttpRequest object are valid only for the duration of the call. The HttpParameter is a container object for the parameters. One can clone the parameters in the request object and save the parameters in an HttpParameter object.
C example:
C++ example:
All parameters are contained within one memory unit and one can simply call baFree(param) when the object is no longer needed.
You use the HttpParameterIterator for iterating the elements in the object.
C example:
C++ Example: See HttpParameterIterator.
#include <HttpServer.h>
Public Member Functions | |
| const char * | getParameter (const char *paramName) |
| Returns the value of a request parameter as a const char*, or null if the parameter does not exist. More... | |
Static Public Member Functions | |
| static U32 | calculateSize (struct HttpRequest *req) |
| Calculate the HttpParameter size. More... | |
| static HttpParameter * | clone (void *buf, struct HttpRequest *req) |
| Copy HTTP parameters to buf and return as a HttpParameter object. More... | |
|
static |
Calculate the HttpParameter size.
| req | Required live request. |
|
static |
Copy HTTP parameters to buf and return as a HttpParameter object.
| buf | Writable, suitably aligned storage of at least calculateSize(req) bytes, and at least sizeof(HttpParameter) even for an empty request. NULL is accepted and returns NULL; no allocation occurs here. |
| req | Required live request; strings are copied. |
| const char * HttpParameter::getParameter | ( | const char * | paramName | ) |
Returns the value of a request parameter as a const char*, or null if the parameter does not exist.
Request parameters are extra information sent with the request, which are contained in the query string or posted form data.
If you use this method with a multivalued parameter, the value returned is equal to the first value in a HttpParameterIterator.
| paramName | Required NUL-terminated, case-sensitive parameter name. |