atscppapi
1.0.9
C++ wrapper for Apache Traffic Server API
|
This class provides an implementation of AsyncProvider that makes HTTP requests asynchronously. This provider automatically self-destructs after the completion of the request. More...
#include "AsyncHttpFetch.h"
Public Types | |
enum | Result { RESULT_SUCCESS = 10000, RESULT_TIMEOUT, RESULT_FAILURE } |
Public Member Functions | |
AsyncHttpFetch (const std::string &url_str, HttpMethod http_method=HTTP_METHOD_GET) | |
Headers & | getRequestHeaders () |
Result | getResult () const |
const Url & | getRequestUrl () const |
const Response & | getResponse () const |
void | getResponseBody (const void *&body, size_t &body_size) const |
virtual void | run (shared_ptr< AsyncDispatchControllerBase > dispatch_controller) |
This class provides an implementation of AsyncProvider that makes HTTP requests asynchronously. This provider automatically self-destructs after the completion of the request.
See example async_http_fetch for sample usage.
Headers & AsyncHttpFetch::getRequestHeaders | ( | ) |
Used to manipulate the headers of the request to be made.
const Url & AsyncHttpFetch::getRequestUrl | ( | ) | const |
const Response & AsyncHttpFetch::getResponse | ( | ) | const |
Used to extract the response after request completion.
void AsyncHttpFetch::getResponseBody | ( | const void *& | body, |
size_t & | body_size | ||
) | const |
Used to extract the body of the response after request completion. On unsuccessful completion, values (NULL, 0) are set.
body | Output argument; will point to the body |
body_size | Output argument; will contain the size of the body |
AsyncHttpFetch::Result AsyncHttpFetch::getResult | ( | ) | const |
Used to extract the response after request completion.
|
virtual |
Starts a HTTP fetch of the Request contained.
Implements atscppapi::AsyncProvider.