When a request is received from a client a method object is created to represent the request method and provide a mechanism for responding.
Note that the handler class hides some of the details of responding. The returned method can be passed to an application-defined root handler object to make it easier to find the resource identified by the URI and execute the method on it.
Public Types | |
typedef boost::shared_ptr< endpoint > | pointer |
shared ptr | |
typedef boost::shared_ptr< const endpoint > | const_pointer |
const shared ptr | |
typedef restcgi::env | env_type |
env type | |
typedef boost::shared_ptr< method > | method_pointer |
method shared ptr | |
Public Member Functions | |
method_pointer | receive () |
const env_type & | env () const |
Get environment. | |
void | env_override (const std::string &name, const std::string &value) |
Override env. | |
Static Public Member Functions | |
static pointer | create () |
Create endpoint from std::cin and std::cout. | |
static pointer | create (std::istream &is, std::ostream &os) |
Create endpoint. | |
static pointer | create (const env_type &e, std::istream &is, std::ostream &os) |
For testing. | |
Friends | |
class | method |
class | icontent |
class | ocontent |
method_pointer restcgi::endpoint::receive | ( | ) |
Receive method. Conceptually, this receives the method request header fields. Received content, if any, can be streamed after this call. Response header and content can be sent using the returned method object.
std::domain_error | if method type unknown (response automatically sent) |