#include <cgicc/CgiEnvironment.h>
Public Methods | |
Constructor and Destructor | |
CgiEnvironment (reader_function_t stream_reader) | |
Read in the CGI environment passed to the CGI application by the server. More... | |
~CgiEnvironment () | |
Destructor. More... | |
Server Information | |
Information on the server handling the HTTP/CGI request | |
std::string | getServerSoftware () const |
Get the name and version of the HTTP server software. More... | |
std::string | getServerName () const |
Get the hostname, DNS name or IP address of the HTTP server. More... | |
std::string | getGatewayInterface () const |
Get the name and version of the gateway interface. More... | |
std::string | getServerProtocol () const |
Get the name and revision of the protocol used for this request. More... | |
unsigned long | getServerPort () const |
Get the port number on the server to which this request was sent. More... | |
bool | usingHTTPS () const |
Determine if this is a secure request. More... | |
CGI Query Information | |
Information specific to this CGI query | |
std::string | getCookies () const |
Get the HTTP cookies associated with this query, if any. More... | |
const std::vector< HTTPCookie > & | getCookieList () const |
Get a vector containing the HTTP cookies associated with this query. More... | |
std::string | getRequestMethod () const |
Get the request method used for this query. More... | |
std::string | getPathInfo () const |
Get the extra path information for this request, given by the client. More... | |
std::string | getPathTranslated () const |
Get the translated path information (virtual to physical mapping). More... | |
std::string | getScriptName () const |
Get the full path to this CGI application. More... | |
std::string | getQueryString () const |
Get the query string for this request. More... | |
unsigned long | getContentLength () const |
Get the length of the data read from standard input, in chars. More... | |
std::string | getContentType () const |
Get the content type of the submitted information. More... | |
std::string | getPostData () const |
Get the data passed to the CGI application via standard input. More... | |
Server Specific Information | |
Information dependent on the type of HTTP server in use | |
std::string | getReferrer () const |
Get the URL of the page which called this CGI application. More... | |
Remote User Information | |
Information about the user making the CGI request | |
std::string | getRemoteHost () const |
Get the hostname of the remote machine making this request. More... | |
std::string | getRemoteAddr () const |
Get the IP address of the remote machine making this request. More... | |
std::string | getAuthType () const |
Get the protocol-specific user authentication method used. More... | |
std::string | getRemoteUser () const |
Get the authenticated remote user name. More... | |
std::string | getRemoteIdent () const |
Get the remote user name retrieved from the server. More... | |
std::string | getAccept () const |
Get the MIME data types accepted by the client's browser. More... | |
std::string | getUserAgent () const |
Get the name of the browser used for this CGI request. More... | |
ErrorDocument Handling | |
std::string | getRedirectRequest () const |
Get the redirect request. More... | |
std::string | getRedirectURL () const |
Get the redirect URL. More... | |
std::string | getRedirectStatus () const |
Get the redirect status. More... | |
Protected Methods | |
Saving and Restoring | |
These are implementation methods only | |
void | save (const std::string &filename) const |
Implementation of save, for saving CGI environments. More... | |
void | restore (const std::string &filename) |
Implementation of restore, for restoring CGI environments. More... | |
Friends | |
class | Cgicc |
The CgiEnvironment
class encapsulates the environment of the CGI application as described by the HTTP server. CgiEnvironment
contains the GET
or POST
data along with all environment variables set by the HTTP server specified in the CGI specification.
Definition at line 76 of file CgiEnvironment.h.
|
Read in the CGI environment passed to the CGI application by the server.
This function is not usually called directly; instead, an object of type CgiEnvironment is retrieved by calling the
|
|
Destructor.
Delete this CgiEnvironment object |
|
Get the MIME data types accepted by the client's browser.
For example
Definition at line 387 of file CgiEnvironment.h. |
|
Get the protocol-specific user authentication method used.
This is only applicable if the server supports user authentication, and the user has authenticated.
Definition at line 352 of file CgiEnvironment.h. |
|
Get the length of the data read from standard input, in chars.
This is usually only valid for scripts called with the POST method.
Definition at line 270 of file CgiEnvironment.h. |
|
Get the content type of the submitted information.
For applications called via the GET method, this information is irrelevant. For applications called with the POST method, this is specifies the MIME type of the information, usually
Definition at line 285 of file CgiEnvironment.h. |
|
Get a
This vector may be empty
Definition at line 205 of file CgiEnvironment.h. |
|
Get the HTTP cookies associated with this query, if any.
The string returned by this method may contain multiple cookies; it is recommended to use the method getCookieList() instead, which returns a
Definition at line 192 of file CgiEnvironment.h. |
|
Get the name and version of the gateway interface.
This is usually
Definition at line 141 of file CgiEnvironment.h. |
|
Get the extra path information for this request, given by the client.
For example, in the string
Definition at line 227 of file CgiEnvironment.h. |
|
Get the translated path information (virtual to physical mapping).
For example,
Definition at line 237 of file CgiEnvironment.h. |
|
Get the data passed to the CGI application via standard input.
This data is of MIME type
Definition at line 295 of file CgiEnvironment.h. |
|
Get the query string for this request.
The query string follows the
Definition at line 260 of file CgiEnvironment.h. |
|
Get the redirect request.
This will only be valid if you are using this script as a script to use in place of the default server messages.
Definition at line 418 of file CgiEnvironment.h. |
|
Get the redirect status.
This will only be valid if you are using this script as a script to use in place of the default server messages.
Definition at line 441 of file CgiEnvironment.h. |
|
Get the redirect URL.
This will only be valid if you are using this script as a script to use in place of the default server messages.
Definition at line 430 of file CgiEnvironment.h. |
|
Get the URL of the page which called this CGI application.
Depending on the HTTP server software, this value may not be set.
Definition at line 313 of file CgiEnvironment.h. |
|
Get the IP address of the remote machine making this request.
This is a standard IP address of the form
Definition at line 341 of file CgiEnvironment.h. |
|
Get the hostname of the remote machine making this request.
This may be either an IP address or a hostname
Definition at line 331 of file CgiEnvironment.h. |
|
Get the remote user name retrieved from the server.
This is only applicable if the server supports RFC 931 identification. This variable should only be used for logging purposes.
Definition at line 377 of file CgiEnvironment.h. |
|
Get the authenticated remote user name.
This is only applicable if the server supports user authentication, and the user has authenticated.
Definition at line 363 of file CgiEnvironment.h. |
|
Get the request method used for this query.
This is usually one of
Definition at line 215 of file CgiEnvironment.h. |
|
Get the full path to this CGI application.
This is useful for self-referencing URIs
Definition at line 247 of file CgiEnvironment.h. |
|
Get the hostname, DNS name or IP address of the HTTP server.
This is not a URL, for example
Definition at line 131 of file CgiEnvironment.h. |
|
Get the port number on the server to which this request was sent.
This will usually be 80.
Definition at line 161 of file CgiEnvironment.h. |
|
Get the name and revision of the protocol used for this request.
This is usually
Definition at line 151 of file CgiEnvironment.h. |
|
Get the name and version of the HTTP server software.
For example,
Definition at line 121 of file CgiEnvironment.h. |
|
Get the name of the browser used for this CGI request.
For example
Definition at line 398 of file CgiEnvironment.h. |
|
Implementation of restore, for restoring CGI environments.
This is called internally by Cgicc
|
|
Implementation of save, for saving CGI environments.
This is called internally by Cgicc
|
|
Determine if this is a secure request.
A secure request is usually made using SSL via HTTPS
Definition at line 171 of file CgiEnvironment.h. |