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.
std::shared_ptr<Response> execute Execute http request.
oatpp::async::CoroutineStarterForResult<const std::shared_ptr<Response>&> executeAsync Same as HttpRequestExecutor::execute() but Async.

HttpRequestExecutor::HttpRequestExecutor

Constructor.

HttpRequestExecutor(const std::shared_ptr<ClientConnectionProvider>& connectionProvider,
                    const std::shared_ptr<const BodyDecoder>& bodyDecoder =
                    std::make_shared<oatpp::web::protocol::http::incoming::SimpleBodyDecoder>())

HttpRequestExecutor::createShared

Create shared HttpRequestExecutor.

static std::shared_ptr<HttpRequestExecutor>
createShared(const std::shared_ptr<ClientConnectionProvider>& connectionProvider,
             const std::shared_ptr<const BodyDecoder>& bodyDecoder =
             std::make_shared<oatpp::web::protocol::http::incoming::SimpleBodyDecoder>())

HttpRequestExecutor::getConnection

Get oatpp::web::client::RequestExecutor::ConnectionHandle

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::execute

Execute http request.

std::shared_ptr<Response> execute(const String& method,
                                  const String& path,
                                  const Headers& headers,
                                  const std::shared_ptr<Body>& body,
                                  const std::shared_ptr<ConnectionHandle>& connectionHandle = nullptr) override

HttpRequestExecutor::executeAsync

Same as HttpRequestExecutor::execute() but Async.

oatpp::async::CoroutineStarterForResult<const std::shared_ptr<Response>&>
executeAsync(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 {}
  };
}}}

Fields

Type Name Summary
std::shared_ptr<oatpp::data::stream::IOStream> connection Connection.

Methods

Return Type Name Summary
[none] HttpConnectionHandle Constructor.

HttpRequestExecutor::HttpConnectionHandle::connection

Connection.

std::shared_ptr<oatpp::data::stream::IOStream> connection

HttpRequestExecutor::HttpConnectionHandle::HttpConnectionHandle

Constructor.

HttpConnectionHandle(const std::shared_ptr<oatpp::data::stream::IOStream>& stream)
  : connection(stream)