#include <cgicc/CgiEnvironment.h>
Public Methods | |
Constructor and Destructor | |
CgiEnvironment (CgiInput *input) | |
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 74 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 389 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 354 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 272 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 287 of file CgiEnvironment.h. |
|
Get a
This vector may be empty
Definition at line 207 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 194 of file CgiEnvironment.h. |
|
Get the name and version of the gateway interface.
This is usually
Definition at line 143 of file CgiEnvironment.h. |
|
Get the extra path information for this request, given by the client.
For example, in the string
Definition at line 229 of file CgiEnvironment.h. |
|
Get the translated path information (virtual to physical mapping).
For example,
Definition at line 239 of file CgiEnvironment.h. |
|
Get the data passed to the CGI application via standard input.
This data is of MIME type
Definition at line 297 of file CgiEnvironment.h. |
|
Get the query string for this request.
The query string follows the
Definition at line 262 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 420 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 443 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 432 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 315 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 343 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 333 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 379 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 365 of file CgiEnvironment.h. |
|
Get the request method used for this query.
This is usually one of
Definition at line 217 of file CgiEnvironment.h. |
|
Get the full path to this CGI application.
This is useful for self-referencing URIs
Definition at line 249 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 133 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 163 of file CgiEnvironment.h. |
|
Get the name and revision of the protocol used for this request.
This is usually
Definition at line 153 of file CgiEnvironment.h. |
|
Get the name and version of the HTTP server software.
For example,
Definition at line 123 of file CgiEnvironment.h. |
|
Get the name of the browser used for this CGI request.
For example
Definition at line 400 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 173 of file CgiEnvironment.h. |