Barracuda Application Server C/C++ Reference
HttpRequest Struct Reference

Detailed Description

The HttpServer creates an HttpRequest object when the HttpServer parses a client request.

The object is passed in as the first argument to the HttpPage service function.

#include <HttpServer.h>

Public Member Functions

int checkMethods (HttpResponse *resp, U32 methods, bool addDefault=TRUE)
 Checks the HTTP method type and sends a response message if condition met. More...
BaBool checkTime (struct HttpResponse *resp, BaTime time)
 Parses and checks if the "If-Modified-Since" time is equal or greater than "time". More...
AuthenticatedUsergetAuthenticatedUser ()
 Returns the authenticated user or NULL if user is not authenticated.
const char * getRequestURI ()
 Returns the pathname. More...
const char * getRequestURL (bool forceHttps=false)
 Reconstructs the URL the client used to make the request. More...
HttpStdHeadersgetStdHeaders ()
 Returns an object containing standard HTTP headers. More...
const char * getVersion ()
 Returns the HTTP version as a string, normally "1.1".
const char * getHeaderValue (const char *name)
 Returns the value of the specified request header. More...
HttpCookiegetCookie (const char *name)
 Returns the requested cookie or NULL if no cookie matches the name. More...
HttpMethod getMethodType ()
 Returns the method type. More...
const char * getMethod ()
 Returns a string representation of the value returned by HttpRequest::getMethodType. More...
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...
int wsUpgrade ()
 Activate a WebSocket handshake. More...
HttpHeader * getHeaders (int *len)
 Return a HTTP header iterator that can iterate and fetch all the HTTP headers. More...
HttpSessiongetSession (BaBool create=true)
 Returns the current HttpSession associated with this request, or if there is no current session and create is true, returns a new session. More...
HttpConnectiongetConnection ()
 Returns the connection object associated with this request.
HttpServergetServer ()
 Returns the web server object.
HttpResponsegetResponse ()
 Returns the HttpResponse object.
HttpCommandgetCommand ()
 Get the HttpCommand object.
HttpInDatagetBuffer ()
 Get the internal rec buffer.

Static Public Member Functions

static const char * getMethod (HttpMethod method)
 Returns a string representation of the argument. More...