Request.hpp

This File On Github
Ask A Question

API: latest
module: oatpp
#include "oatpp/web/protocol/http/outgoing/Request.hpp"

Request

Class http::outgoing::Request AKA OutgoingRequest represents client's outgoing request to server.

namespace oatpp { namespace web { namespace protocol { namespace http { namespace outgoing { 
  class Request : public oatpp::base::Countable, public std::enable_shared_from_this<Request> {}
}}}}}

Typedefs

Type Name Summary
protocol::http::Headers Headers Convenience typedef for oatpp::web::protocol::http::Headers.

Methods

Return Type Name Summary
[none] Request Constructor.
std::shared_ptr<Request> createShared Create shared Request.
const oatpp::data::share::StringKeyLabel& getMethod Get http method.
const oatpp::data::share::StringKeyLabel& getPath Get path to resource.
Headers& getHeaders Get headers map.
void putHeader Put http header to headers map.
bool putHeaderIfNotExists Put http header to headers map if no header with such name exists.
std::shared_ptr<Body> getBody Get http body.
void send Write request to stream.
oatpp::async::CoroutineStarter sendAsync Write request to stream in asynchronous manner.

Request::Headers

Convenience typedef for oatpp::web::protocol::http::Headers.

typedef protocol::http::Headers Headers

Request::Request

Constructor.

Request(const oatpp::data::share::StringKeyLabel& method,
        const oatpp::data::share::StringKeyLabel& path,
        const Headers& headers,
        const std::shared_ptr<Body>& body)

Request::createShared

Create shared Request.

static std::shared_ptr<Request> createShared(const oatpp::data::share::StringKeyLabel& method,
                                             const oatpp::data::share::StringKeyLabel& path,
                                             const Headers& headers,
                                             const std::shared_ptr<Body>& body)

Request::getMethod

Get http method.

const oatpp::data::share::StringKeyLabel& getMethod() const

Request::getPath

Get path to resource.

const oatpp::data::share::StringKeyLabel& getPath() const

Request::getHeaders

Get headers map.

Headers& getHeaders()

Request::putHeader

Put http header to headers map.

void putHeader(const oatpp::data::share::StringKeyLabelCI_FAST& key, const oatpp::data::share::StringKeyLabel& value)

Request::putHeaderIfNotExists

Put http header to headers map if no header with such name exists. Leave old "name: value" in case such header exists.

bool putHeaderIfNotExists(const oatpp::data::share::StringKeyLabelCI_FAST& key, const oatpp::data::share::StringKeyLabel& value)

Request::getBody

Get http body.

std::shared_ptr<Body> getBody()

Request::send

Write request to stream.

void send(const std::shared_ptr<data::stream::OutputStream>& stream)

Request::sendAsync

Write request to stream in asynchronous manner.

oatpp::async::CoroutineStarter sendAsync(const std::shared_ptr<data::stream::OutputStream>& stream)