|
ofxHTTP
A collection of tools for HTTP.
|
A base implementation of route settings. More...
#include <BaseRoute.h>
Public Types | |
| typedef std::set< std::string > | HTTPMethodSet |
| A typedef for HTTPMethodSet. | |
| typedef std::set< std::string > | MediaTypeSet |
| A typedef for a MediaTypeSet. | |
Public Member Functions | |
| BaseRouteSettings (const std::string &routePathPattern=BaseRouteSettings::DEFAULT_ROUTE_PATH_PATTERN, bool requireSecurePort=false, bool requireAuthentication=false, const HTTPMethodSet &validHTTPMethods=HTTPMethodSet()) | |
| Create the BaseRouteSettings with the given route path. More... | |
| virtual | ~BaseRouteSettings () |
| Destroy the BaseRoutSettings. | |
| void | setRoutePathPattern (const std::string &routePathPattern) |
| Set the route path regex pattern. More... | |
| const std::string & | getRoutePathPattern () const |
| void | setRequireSecurePort (bool requireSecurePort) |
| Set the secure port requirement. More... | |
| bool | requireSecurePort () const |
| void | setRequireAuthentication (bool requireAuthentication) |
| Set the authentication requirement. More... | |
| bool | requireAuthentication () const |
| void | setValidHTTPMethods (const HTTPMethodSet &validHTTPMethods) |
| Set the list of valid HTTPMethods. More... | |
| const HTTPMethodSet & | getValidHTTPMethods () const |
| void | setValidContentTypes (const MediaTypeSet &validContentTypes) |
| Set the list of valid Content Types. More... | |
| const MediaTypeSet & | getValidContentTypes () const |
Static Public Attributes | |
| static const std::string | DEFAULT_ROUTE_PATH_PATTERN = "/.*" |
| The default route path regex pattern. More... | |
A base implementation of route settings.
These settings define the basic information needed to implement BaseRoute::canHandleRequest() method.
| ofx::HTTP::BaseRouteSettings::BaseRouteSettings | ( | const std::string & | routePathPattern = BaseRouteSettings::DEFAULT_ROUTE_PATH_PATTERN, |
| bool | requireSecurePort = false, |
||
| bool | requireAuthentication = false, |
||
| const HTTPMethodSet & | validHTTPMethods = HTTPMethodSet() |
||
| ) |
Create the BaseRouteSettings with the given route path.
| routePathPattern | The regex pattern that this route will handle. |
| requireSecurePort | True if this route requires communication on an SSL encrypted port. |
| requireAuthentication | Require authenticated requests. |
| validHTTPMethods | The valid HTTP Methods that this route will handle. |
| const std::string & ofx::HTTP::BaseRouteSettings::getRoutePathPattern | ( | ) | const |
| const BaseRouteSettings::MediaTypeSet & ofx::HTTP::BaseRouteSettings::getValidContentTypes | ( | ) | const |
| const BaseRouteSettings::HTTPMethodSet & ofx::HTTP::BaseRouteSettings::getValidHTTPMethods | ( | ) | const |
| bool ofx::HTTP::BaseRouteSettings::requireAuthentication | ( | ) | const |
| bool ofx::HTTP::BaseRouteSettings::requireSecurePort | ( | ) | const |
| void ofx::HTTP::BaseRouteSettings::setRequireAuthentication | ( | bool | requireAuthentication | ) |
Set the authentication requirement.
| requireAuthentication | Set to true if this route requires authentication. |
| void ofx::HTTP::BaseRouteSettings::setRequireSecurePort | ( | bool | requireSecurePort | ) |
Set the secure port requirement.
| requireSecurePort | Set to true if this route can only handle requests submitted on an SSL encrypted port. |
| void ofx::HTTP::BaseRouteSettings::setRoutePathPattern | ( | const std::string & | routePathPattern | ) |
Set the route path regex pattern.
| routePathPattern | The regex pattern that this route will handle. |
| void ofx::HTTP::BaseRouteSettings::setValidContentTypes | ( | const MediaTypeSet & | validContentTypes | ) |
Set the list of valid Content Types.
| validContentTypes | A set of valid content types. |
| void ofx::HTTP::BaseRouteSettings::setValidHTTPMethods | ( | const HTTPMethodSet & | validHTTPMethods | ) |
Set the list of valid HTTPMethods.
| validHTTPMethods | A set of valid HTTPMethods. |
|
static |
The default route path regex pattern.
By default, this pattern matches all requests.