10Duke Enterprise C++ SDK
Loading...
Searching...
No Matches
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]

Copy-constructs new instance.

Parameters
original-

Member Function Documentation

◆ getContentType()

Returns response content type.

Returns
-

◆ getPayloadAsString()

Returns the response entity (payload) as string.

Returns
-

◆ getPayloadLength()

Returns length of the response entity /payload).

Returns
-

◆ getStatusCode()

Returns the HTTP-status code.

Returns
the HTTP-status code

◆ isSuccessful()

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:
  • core/core/src/http/HTTPResponse.h
  • core/core/src/http/HTTPResponse.cpp