DtoBody.hpp

This File On Github
Ask A Question

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

DtoBody

Implementation of oatpp::web::protocol::http::outgoing::Body class.
Extends of oatpp::web::protocol::http::outgoing::ChunkedBufferBody class.
Implements functionality to use DTO Object (see Data Transfer Object (DTO)) as data source for http body.

namespace oatpp { namespace web { namespace protocol { namespace http { namespace outgoing { 
  class DtoBody : public ChunkedBufferBody {}
}}}}}

Methods

Return Type Name Summary
[none] DtoBody Constructor.
std::shared_ptr<DtoBody> createShared Create shared DtoBody.
void declareHeaders Add Content-Length header.
data::v_io_size getKnownSize Return known size of the body.

DtoBody::DtoBody

Constructor.

DtoBody(const oatpp::data::mapping::type::AbstractObjectWrapper& dto,
        oatpp::data::mapping::ObjectMapper* objectMapper)

DtoBody::createShared

Create shared DtoBody.

static std::shared_ptr<DtoBody> createShared(const oatpp::data::mapping::type::AbstractObjectWrapper& dto,
                                             oatpp::data::mapping::ObjectMapper* objectMapper)

DtoBody::declareHeaders

Add Content-Length header.

Add Content-Type header depending on oatpp::data::mapping::ObjectMapper used. See oatpp::data::mapping::ObjectMapper::Info.

void declareHeaders(Headers& headers) noexcept override

DtoBody::getKnownSize

Return known size of the body.

data::v_io_size getKnownSize() override