# HttpRequestExecutor.hpp
This File On Github
Ask A Question
API: latest
module: oatpp
#include "oatpp/web/client/HttpRequestExecutor.hpp"
# HttpRequestExecutor
Default implementation of oatpp::web::client::RequestExecutor for making http request.
namespace oatpp { namespace web { namespace client {
class HttpRequestExecutor : public oatpp::base::Countable, public RequestExecutor {}
}}}
# Methods
Return Type | Name | Summary |
---|---|---|
[none] | HttpRequestExecutor | Constructor. |
std::shared_ptr<HttpRequestExecutor> | createShared | Create shared HttpRequestExecutor. |
std::shared_ptr<ConnectionHandle> | getConnection | Get oatpp::web::client::RequestExecutor::ConnectionHandle |
oatpp::async::CoroutineStarterForResult<const std::shared_ptr<HttpRequestExecutor::ConnectionHandle>&> | getConnectionAsync | Same as HttpRequestExecutor::getConnection() but async. |
void | invalidateConnection | Invalidate connection. |
std::shared_ptr<Response> | executeOnce | Execute http request. |
oatpp::async::CoroutineStarterForResult<const std::shared_ptr<Response>&> | executeOnceAsync | Same as HttpRequestExecutor::execute() but Async. |
# HttpRequestExecutor::HttpRequestExecutor
Constructor.
- @param connectionProvider - oatpp::network::ClientConnectionProvider.
- @param bodyDecoder - oatpp::web::protocol::http::incoming::BodyDecoder.
HttpRequestExecutor(const std::shared_ptr<ClientConnectionProvider>& connectionProvider,
const std::shared_ptr<RetryPolicy>& retryPolicy = nullptr,
const std::shared_ptr<const BodyDecoder>& bodyDecoder =
std::make_shared<oatpp::web::protocol::http::incoming::SimpleBodyDecoder>())
# HttpRequestExecutor::createShared
Create shared HttpRequestExecutor.
- @param connectionProvider - oatpp::network::ClientConnectionProvider.
- @param bodyDecoder - oatpp::web::protocol::http::incoming::BodyDecoder.
- @return -
std::shared_ptr
toHttpRequestExecutor
.
static std::shared_ptr<HttpRequestExecutor>
createShared(const std::shared_ptr<ClientConnectionProvider>& connectionProvider,
const std::shared_ptr<RetryPolicy>& retryPolicy = nullptr,
const std::shared_ptr<const BodyDecoder>& bodyDecoder =
std::make_shared<oatpp::web::protocol::http::incoming::SimpleBodyDecoder>())
# HttpRequestExecutor::getConnection
Get oatpp::web::client::RequestExecutor::ConnectionHandle
- @return - ConnectionHandle which is HttpRequestExecutor::HttpConnectionHandle.
std::shared_ptr<ConnectionHandle> getConnection() override
# HttpRequestExecutor::getConnectionAsync
Same as HttpRequestExecutor::getConnection() but async.
- @return - oatpp::async::CoroutineStarterForResult.
oatpp::async::CoroutineStarterForResult<const std::shared_ptr<HttpRequestExecutor::ConnectionHandle>&> getConnectionAsync() override
# HttpRequestExecutor::invalidateConnection
Invalidate connection.
- @param connectionHandle
void invalidateConnection(const std::shared_ptr<ConnectionHandle>& connectionHandle) override
# HttpRequestExecutor::executeOnce
Execute http request.
- @param method - method ex: ["GET", "POST", "PUT", etc.].
- @param path - path to resource.
- @param headers - headers map oatpp::web::client::RequestExecutor::Headers.
- @param body -
std::shared_ptr
to oatpp::web::client::RequestExecutor::Body object. - @param connectionHandle - ConnectionHandle obtain in call to HttpRequestExecutor::getConnection().
- @return - oatpp::web::protocol::http::incoming::Response.
- @throws - oatpp::web::client::RequestExecutor::RequestExecutionError
std::shared_ptr<Response> executeOnce(const String& method,
const String& path,
const Headers& headers,
const std::shared_ptr<Body>& body,
const std::shared_ptr<ConnectionHandle>& connectionHandle = nullptr) override
# HttpRequestExecutor::executeOnceAsync
Same as HttpRequestExecutor::execute() but Async.
- @param method - method ex: ["GET", "POST", "PUT", etc.].
- @param path - path to resource.
- @param headers - headers map oatpp::web::client::RequestExecutor::Headers.
- @param body -
std::shared_ptr
to oatpp::web::client::RequestExecutor::Body object. - @param connectionHandle - ConnectionHandle obtain in call to HttpRequestExecutor::getConnection().
- @return - oatpp::async::CoroutineStarterForResult.
oatpp::async::CoroutineStarterForResult<const std::shared_ptr<Response>&>
executeOnceAsync(const String& method,
const String& path,
const Headers& headers,
const std::shared_ptr<Body>& body,
const std::shared_ptr<ConnectionHandle>& connectionHandle = nullptr) override
# HttpRequestExecutor::HttpConnectionHandle
Connection handle for HttpRequestExecutor
For more details see oatpp::web::client::RequestExecutor::ConnectionHandle.
namespace oatpp { namespace web { namespace client {
class HttpRequestExecutor : public oatpp::base::Countable, public RequestExecutor {
class HttpConnectionHandle : public ConnectionHandle {}
};
}}}