|
net-cpp
..
C++11 library for networking purposes
|
#include <client.h>
Inheritance diagram for core::net::http::Client:
Collaboration diagram for core::net::http::Client:Classes | |
| struct | Errors |
| Summarizes error conditions. More... | |
| struct | Timings |
| Summarizes timing information about completed requests. More... | |
Public Member Functions | |
| Client (const Client &)=delete | |
| virtual | ~Client ()=default |
| Client & | operator= (const Client &)=delete |
| bool | operator== (const Client &) const =delete |
| virtual std::string | uri_to_string (const core::net::Uri &uri) const |
| virtual std::string | url_escape (const std::string &s) const =0 |
| Percent-encodes the given string. More... | |
| virtual std::string | base64_encode (const std::string &s) const =0 |
| Base64-encodes the given string. More... | |
| virtual std::string | base64_decode (const std::string &s) const =0 |
| Base64-decodes the given string. More... | |
| virtual Timings | timings ()=0 |
| Queries timing statistics over all requests that have been executed by this client. More... | |
| virtual void | run ()=0 |
| Execute the client and any impl-specific thread-pool or runtime. More... | |
| virtual void | stop ()=0 |
| Stop the client and any impl-specific thread-pool or runtime. More... | |
| virtual std::shared_ptr< Request > | get (const Request::Configuration &configuration)=0 |
| get is a convenience method for issueing a GET request for the given URI. More... | |
| virtual std::shared_ptr< Request > | head (const Request::Configuration &configuration)=0 |
| head is a convenience method for issueing a HEAD request for the given URI. More... | |
| virtual std::shared_ptr< Request > | put (const Request::Configuration &configuration, std::istream &payload, std::size_t size)=0 |
| put is a convenience method for issuing a PUT request for the given URI. More... | |
| virtual std::shared_ptr< Request > | post (const Request::Configuration &configuration, const std::string &payload, const std::string &type)=0 |
| post is a convenience method for issuing a POST request for the given URI. More... | |
| virtual std::shared_ptr< Request > | post_form (const Request::Configuration &configuration, const std::map< std::string, std::string > &values) |
| post_form is a convenience method for issuing a POST request for the given URI, with url-encoded payload. More... | |
| std::shared_ptr< Request > | post (const Request::Configuration &configuration, std::istream &payload, std::size_t size) |
| post is a convenience method for issuing a POST request for the given URI. More... | |
| std::shared_ptr< Request > | del (const Request::Configuration &configuration) |
| del is a convenience method for issueing a DELETE request for the given URI. More... | |
Protected Member Functions | |
| Client ()=default | |
|
delete |
|
virtualdefault |
|
protecteddefault |
|
pure virtual |
Base64-decodes the given string.
|
pure virtual |
Base64-encodes the given string.
| std::shared_ptr<Request> core::net::http::Client::del | ( | const Request::Configuration & | configuration | ) |
del is a convenience method for issueing a DELETE request for the given URI.
| Errors::HttpMethodNotSupported | if the underlying implementation does not support the provided HTTP method. |
| configuration | The configuration to issue a get request for. |
|
pure virtual |
get is a convenience method for issueing a GET request for the given URI.
| Errors::HttpMethodNotSupported | if the underlying implementation does not support the provided HTTP method. |
| configuration | The configuration to issue a get request for. |
|
pure virtual |
head is a convenience method for issueing a HEAD request for the given URI.
| Errors::HttpMethodNotSupported | if the underlying implementation does not support the provided HTTP method. |
| configuration | The configuration to issue a get request for. |
|
delete |
|
pure virtual |
post is a convenience method for issuing a POST request for the given URI.
| Errors::HttpMethodNotSupported | if the underlying implementation does not support the provided HTTP method. |
| configuration | The configuration to issue a get request for. |
| payload | The data to be transmitted as part of the POST request. |
| type | The content-type of the data. |
| std::shared_ptr<Request> core::net::http::Client::post | ( | const Request::Configuration & | configuration, |
| std::istream & | payload, | ||
| std::size_t | size | ||
| ) |
post is a convenience method for issuing a POST request for the given URI.
| Errors::HttpMethodNotSupported | if the underlying implementation does not support the pro vided HTTP method. |
| configuration | The configuration to issue a get request for. |
| payload | The data to be transmitted as part of the POST request. |
| size | Size of the payload data in bytes. |
|
virtual |
post_form is a convenience method for issuing a POST request for the given URI, with url-encoded payload.
| Errors::HttpMethodNotSupported | if the underlying implementation does not support the provided HTTP method. |
| configuration | The configuration to issue a get request for. |
| values | Key-value pairs to be added to the payload in url-encoded format. |
|
pure virtual |
put is a convenience method for issuing a PUT request for the given URI.
| Errors::HttpMethodNotSupported | if the underlying implementation does not support the provided HTTP method. |
| configuration | The configuration to issue a get request for. |
| payload | The data to be transmitted as part of the PUT request. |
| size | Size of the payload data in bytes. |
|
pure virtual |
Execute the client and any impl-specific thread-pool or runtime.
|
pure virtual |
Stop the client and any impl-specific thread-pool or runtime.
|
pure virtual |
Queries timing statistics over all requests that have been executed by this client.
|
virtual |
|
pure virtual |
Percent-encodes the given string.