|
10Duke Enterprise C++ SDK
|
HTTP-related services.
This namespace contains services related to HTTP. This particular namespace itself contains service interface for a generic HTTP-client, which is used in across the 10Duke C++ client. This allows the actual HTTP-implementation to be changed, if necessary.
Namespaces | |
| namespace | curl |
| Implementation of HTTP-client using libcurl. | |
| namespace | server |
| Simple HTTP-server. | |
Classes | |
| class | BadRequest |
| Thrown for HTTP status code 400 "BadRequest". More... | |
| class | ClientError |
| 4xx-series, base class for many 4xx-exceptions. More... | |
| class | Forbidden |
| Thrown for HTTP status code 403, "Forbidden". More... | |
| class | HTTPCall |
| HTTP-call which executes the request and returns HTTPResponse. More... | |
| class | HTTPClient |
| A simple HTTP-client. More... | |
| class | HTTPException |
| A generic HTTP-exception. More... | |
| class | HTTPRequest |
| HTTP-request, which contains all necessary details to construct the request. More... | |
| class | HTTPRequestAuthenticator |
| This is a service, that can be added to tenduke::http::HTTPRequest to add authentication information to the request. More... | |
| class | HTTPRequestBuilder |
| Builds HTTPRequest. More... | |
| class | HTTPRequestException |
| This exception is thrown when a HTTP-request fails for HTTP-specific reasons in the client end. More... | |
| class | HTTPResponse |
| A HTTP Response. More... | |
| class | HTTPResponseException |
| This exception is thrown when HTTP-request fails because of HTTP-statuscode. More... | |
| class | HTTPResponseToException |
| Utility service to throw an exception based on tenduke::http::HTTPResponse. More... | |
| class | NotFound |
| Thrown for HTTP status code 404, "Not Found". More... | |
| class | ServerError |
| 5xx-error, base class for 5xx-exceptions. More... | |
| class | Unauthorized |
| Thrown for HTTP status code 401, "Unauthorized". More... | |
Functions | |
| void | validateHTTPHeader (const std::string &name, const std::string &value) |
| Checks that a request header can be sent as is, without changing the meaning of the request. | |
Variables | |
| const long | DEFAULT_CONNECTION_TIMEOUT_MS = 30L * 1000L |
| Default connection time out in milliseconds. | |
| const long | DEFAULT_TIMEOUT_MS = 60L * 1000L |
| Default total time out in milliseconds. | |
| const std::size_t | DEFAULT_MAX_RESPONSE_BODY_SIZE = 10 * 1024 * 1024 |
| Default maximum size of a response body in bytes (10 MiB). | |
| void tenduke::http::validateHTTPHeader | ( | const std::string & | name, |
| const std::string & | value ) |
Checks that a request header can be sent as is, without changing the meaning of the request.
Accepts (see https://www.rfc-editor.org/rfc/rfc9110#section-5):
Rejects e.g. CR and LF, which would end the header and let the rest of the value inject extra headers.
| name | name of the header |
| value | value of the header |
| tenduke::http::HTTPRequestException | if the name or the value is not valid |
| const std::size_t tenduke::http::DEFAULT_MAX_RESPONSE_BODY_SIZE = 10 * 1024 * 1024 |
Default maximum size of a response body in bytes (10 MiB).
A larger response is aborted.
| const long tenduke::http::DEFAULT_TIMEOUT_MS = 60L * 1000L |
Default total time out in milliseconds.
A time out of 0 means the request does not time out.