ofxHTTP
A collection of tools for HTTP.
|
Settings for a PostRoute. More...
#include <PostRoute.h>
Public Types | |
enum | Defaults { DEFAULT_POST_BUFFER_SIZE = 8192, DEFAULT_FIELD_LIMIT = 100, DEFAULT_MAXIMUM_FILE_UPLOAD_SIZE = 2097152 } |
Default values. More... | |
Public Types inherited from ofx::HTTP::BaseRouteSettings | |
typedef std::set< std::string > | HTTPMethodSet |
A typedef for HTTPMethodSet. | |
typedef std::set< std::string > | MediaTypeSet |
A typedef for a MediaTypeSet. | |
Public Member Functions | |
PostRouteSettings (const std::string &routePathPattern=DEFAULT_POST_ROUTE, bool requireSecurePort=false, bool requireAuthentication=false) | |
Create PostRouteSettings. More... | |
virtual | ~PostRouteSettings () |
Destroy the PostRouteSetting. | |
void | setUploadFolder (const std::string &uploadFolder) |
const std::string & | getUploadFolder () const |
void | setUploadRedirect (const std::string &uploadRedirect) |
const std::string & | getUploadRedirect () const |
void | setWriteBufferSize (std::size_t writeBufferSize) |
std::size_t | getWriteBufferSize () const |
void | setFieldLimit (std::size_t fieldLimit) |
std::size_t | getFieldLimit () const |
void | setMaximumFileUploadSize (uint64_t maximumFileUploadSize) |
Set the maximum file upload size in bytes. More... | |
uint64_t | getMaximumFileUploadSize () const |
Get the maximum file upload size. More... | |
Public Member Functions inherited from 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. 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_POST_ROUTE = "/post" |
static const std::string | DEFAULT_POST_FOLDER = "uploads/" |
static const std::string | DEFAULT_POST_REDIRECT = "uploaded.html" |
static const std::string | DEFAULT_POST_HTTP_METHODS_ARRAY [] = { "POST" } |
An unfortunate compromise until C++11. More... | |
static const HTTPMethodSet | DEFAULT_POST_HTTP_METHODS |
The default HTTP methods for this route. | |
Static Public Attributes inherited from ofx::HTTP::BaseRouteSettings | |
static const std::string | DEFAULT_ROUTE_PATH_PATTERN = "/.*" |
The default route path regex pattern. More... | |
Settings for a PostRoute.
ofx::HTTP::PostRouteSettings::PostRouteSettings | ( | const std::string & | routePathPattern = DEFAULT_POST_ROUTE , |
bool | requireSecurePort = false , |
||
bool | requireAuthentication = false |
||
) |
Create PostRouteSettings.
routePathPattern | The regex pattern that this route will handle. |
requireSecurePort | True if this route requires communication on an SSL encrypted port. |
uint64_t ofx::HTTP::PostRouteSettings::getMaximumFileUploadSize | ( | ) | const |
Get the maximum file upload size.
void ofx::HTTP::PostRouteSettings::setMaximumFileUploadSize | ( | uint64_t | maximumFileUploadSize | ) |
Set the maximum file upload size in bytes.
maximumFileUploadSize | The maximum file upload size in bytes. |
|
static |
An unfortunate compromise until C++11.