aws-crt-cpp
C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS implementations for C++.
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Aws::Crt::Http::HttpMessage Class Reference

#include <HttpRequestResponse.h>

Inheritance diagram for Aws::Crt::Http::HttpMessage:
Aws::Crt::Http::HttpRequest Aws::Crt::Http::HttpResponse

Public Member Functions

virtual ~HttpMessage ()
 
 HttpMessage (const HttpMessage &)=delete
 
 HttpMessage (HttpMessage &&)=delete
 
HttpMessageoperator= (const HttpMessage &)=delete
 
HttpMessageoperator= (HttpMessage &&)=delete
 
std::shared_ptr< Aws::Crt::Io::InputStreamGetBody () const noexcept
 
bool SetBody (const std::shared_ptr< Aws::Crt::Io::IStream > &body) noexcept
 
bool SetBody (const std::shared_ptr< Aws::Crt::Io::InputStream > &body) noexcept
 
size_t GetHeaderCount () const noexcept
 
Optional< HttpHeaderGetHeader (size_t index) const noexcept
 
bool AddHeader (const HttpHeader &header) noexcept
 
bool EraseHeader (size_t index) noexcept
 
 operator bool () const noexcept
 

Protected Member Functions

 HttpMessage (Allocator *allocator, struct aws_http_message *message) noexcept
 

Protected Attributes

Allocatorm_allocator
 
struct aws_http_message * m_message
 
std::shared_ptr< Aws::Crt::Io::InputStreamm_bodyStream
 

Detailed Description

Base class representing a mutable http request or response.

Constructor & Destructor Documentation

Aws::Crt::Http::HttpMessage::~HttpMessage ( )
virtual
Aws::Crt::Http::HttpMessage::HttpMessage ( const HttpMessage )
delete
Aws::Crt::Http::HttpMessage::HttpMessage ( HttpMessage &&  )
delete
Aws::Crt::Http::HttpMessage::HttpMessage ( Allocator allocator,
struct aws_http_message *  message 
)
protectednoexcept

Member Function Documentation

bool Aws::Crt::Http::HttpMessage::AddHeader ( const HttpHeader header)
noexcept

Adds a header to the request

Parameters
headerheader to add
Returns
success/failure
bool Aws::Crt::Http::HttpMessage::EraseHeader ( size_t  index)
noexcept

Removes a header from the request

Parameters
indexindex of the header to remove
Returns
success/failure
std::shared_ptr< Aws::Crt::Io::InputStream > Aws::Crt::Http::HttpMessage::GetBody ( ) const
noexcept

Gets the input stream representing the message body

Optional< HttpHeader > Aws::Crt::Http::HttpMessage::GetHeader ( size_t  index) const
noexcept

Gets a particular header in the request

Parameters
indexindex of the header to fetch
Returns
an option containing the requested header if the index is in bounds
size_t Aws::Crt::Http::HttpMessage::GetHeaderCount ( ) const
noexcept

Gets the number of headers contained in this request

Returns
the number of headers contained in this request
Aws::Crt::Http::HttpMessage::operator bool ( ) const
inlinenoexcept
Returns
true/false if the underlying object is valid
HttpMessage& Aws::Crt::Http::HttpMessage::operator= ( const HttpMessage )
delete
HttpMessage& Aws::Crt::Http::HttpMessage::operator= ( HttpMessage &&  )
delete
bool Aws::Crt::Http::HttpMessage::SetBody ( const std::shared_ptr< Aws::Crt::Io::IStream > &  body)
noexcept

Sets the input stream representing the message body

Parameters
bodythe input stream representing the message body
Returns
success/failure
bool Aws::Crt::Http::HttpMessage::SetBody ( const std::shared_ptr< Aws::Crt::Io::InputStream > &  body)
noexcept

Sets the input stream representing the message body

Parameters
bodythe input stream representing the message body
Returns
success/failure

Member Data Documentation

Allocator* Aws::Crt::Http::HttpMessage::m_allocator
protected
std::shared_ptr<Aws::Crt::Io::InputStream> Aws::Crt::Http::HttpMessage::m_bodyStream
protected
struct aws_http_message* Aws::Crt::Http::HttpMessage::m_message
protected

The documentation for this class was generated from the following files: