ofxHTTP
A collection of tools for HTTP.
|
A route for handing HTTP POST requests. More...
#include <PostRoute.h>
Public Types | |
typedef PostRouteSettings | Settings |
A typedef for the PostRouteSettings. | |
Public Member Functions | |
PostRoute (const Settings &settings=Settings()) | |
Poco::Net::HTTPRequestHandler * | createRequestHandler (const Poco::Net::HTTPServerRequest &request) override |
Creates a new HTTPRequestHandler for the given request. More... | |
PostRouteEvents & | getEvents () |
template<class ListenerClass > | |
void | registerPostEvents (ListenerClass *listener, int priority=OF_EVENT_ORDER_AFTER_APP) |
Register event listeners for this route. More... | |
template<class ListenerClass > | |
void | unregisterPostEvents (ListenerClass *listener, int priority=OF_EVENT_ORDER_AFTER_APP) |
Unregister event listeners for this route. More... | |
Public Member Functions inherited from ofx::HTTP::BaseRoute_< PostRouteSettings > | |
BaseRoute_ (const PostRouteSettings &settings=PostRouteSettings()) | |
Create a BaseRoute. More... | |
virtual | ~BaseRoute_ () |
Destroy a BaseRoute. | |
virtual void | setup (const PostRouteSettings &settings) |
Setup the route with settings. More... | |
virtual std::string | routePathPattern () const override |
Get the route's regex path pattern. More... | |
virtual bool | canHandleRequest (const Poco::Net::HTTPServerRequest &request, bool isSecurePort) const override |
Determine if this route can handle the given request. More... | |
void | handleRequest (Poco::Net::HTTPServerRequest &request, Poco::Net::HTTPServerResponse &response) override |
virtual void | handleRequest (ServerEventArgs &evt) override |
Handle the ServerEventArgs. More... | |
virtual void | stop () override |
Stop any pending activity and close this route. More... | |
const PostRouteSettings & | settings () const |
AbstractServer * | getServer () override |
void | setServer (AbstractServer *server) override |
Set the server that owns this route. More... | |
Public Member Functions inherited from ofx::HTTP::AbstractRoute | |
virtual | ~AbstractRoute () |
Destroy the AbstractRoute instance. | |
Public Member Functions inherited from ofx::HTTP::AbstractHTTPRequestHandler | |
virtual | ~AbstractHTTPRequestHandler () |
Destroy the AbstractHTTPRequestHandler. | |
Public Member Functions inherited from ofx::HTTP::AbstractServerEventRequestHandler | |
virtual | ~AbstractServerEventRequestHandler () |
Destroy the AbstractServerEventRequestHandler. | |
Public Member Functions inherited from ofx::HTTP::AbstractHTTPRequestHandlerFactory | |
virtual | ~AbstractHTTPRequestHandlerFactory () |
Destroy the AbstractHTTPRequestHandlerFactory. | |
Public Attributes | |
PostRouteEvents | events |
Additional Inherited Members | |
Protected Attributes inherited from ofx::HTTP::BaseRoute_< PostRouteSettings > | |
PostRouteSettings | _settings |
The settings. | |
AbstractServer * | _server |
A pointer to the server. | |
A route for handing HTTP POST requests.
|
overridevirtual |
Creates a new HTTPRequestHandler for the given request.
Before this is called, it is expected that the calling server has confirmed that this route is capable of handling the request by calling canHandleRequest().
request | The HTTPServerRequest to be passed to the handler. |
Reimplemented from ofx::HTTP::BaseRoute_< PostRouteSettings >.
void ofx::HTTP::PostRoute::registerPostEvents | ( | ListenerClass * | listener, |
int | priority = OF_EVENT_ORDER_AFTER_APP |
||
) |
Register event listeners for this route.
The listener class must implement the following callbacks:
onHTTPPostEvent(...), onHTTPFormEvent(...), onHTTPUploadEvent(...)
ListenerClass | The lister class to register. |
listener | A pointer to the listener class. |
priority | The listener priority. |
void ofx::HTTP::PostRoute::unregisterPostEvents | ( | ListenerClass * | listener, |
int | priority = OF_EVENT_ORDER_AFTER_APP |
||
) |
Unregister event listeners for this route.
ListenerClass | The lister class to uregister. |
listener | A pointer to the listener class. |
priority | The listener priority. |