10Duke Scale C++ Client
Loading...
Searching...
No Matches
tenduke::http::HTTPResponse Class Reference

#include <HTTPResponse.h>

Detailed Description

A HTTP Response.

Public Member Functions

 HTTPResponse (int statusCode, std::multimap< std::string, std::string > headers, std::unique_ptr< tenduke::utl::BinaryData > data)
 Constructs new instance.
 
 HTTPResponse (const HTTPResponse &original)
 Copy-constructs new instance.
 
virtual std::string getContentType ()
 Returns response content type.
 
virtual std::string getPayloadAsString ()
 Returns the response entity (payload) as string.
 
virtual std::size_t getPayloadLength ()
 Returns length of the response entity /payload).
 
int getStatusCode () const
 Returns the HTTP-status code.
 
bool isSuccessful () const
 Checks if the request is successful based on the HTTP status code.
 

Constructor & Destructor Documentation

◆ HTTPResponse() [1/2]

tenduke::http::HTTPResponse::HTTPResponse ( int  statusCode,
std::multimap< std::string, std::string >  headers,
std::unique_ptr< tenduke::utl::BinaryData data 
)

Constructs new instance.

Parameters
statusCode-
headers-
data-

◆ HTTPResponse() [2/2]

tenduke::http::HTTPResponse::HTTPResponse ( const HTTPResponse original)

Copy-constructs new instance.

Parameters
original-

Member Function Documentation

◆ getContentType()

std::string tenduke::http::HTTPResponse::getContentType ( )
virtual

Returns response content type.

Returns
-

◆ getPayloadAsString()

std::string tenduke::http::HTTPResponse::getPayloadAsString ( )
virtual

Returns the response entity (payload) as string.

Returns
-

◆ getPayloadLength()

size_t tenduke::http::HTTPResponse::getPayloadLength ( )
virtual

Returns length of the response entity /payload).

Returns
-

◆ getStatusCode()

int tenduke::http::HTTPResponse::getStatusCode ( ) const
inline

Returns the HTTP-status code.

Returns
the HTTP-status code

◆ isSuccessful()

bool tenduke::http::HTTPResponse::isSuccessful ( ) const

Checks if the request is successful based on the HTTP status code.

Returns
true if the request is "successful" based on HTTP status code.

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