Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::net::http::ResponseHeader Class Reference

Response Header Class. More...

#include <ResponseHeader.h>

Inheritance diagram for sese::net::http::ResponseHeader:
sese::net::http::Header sese::net::http::Response

Public Types

using Ptr = std::unique_ptr<ResponseHeader>
 
- Public Types inherited from sese::net::http::Header
using Ptr = std::unique_ptr<Header>
 
using KeyValueType = std::pair<std::string, std::string>
 

Public Member Functions

 ResponseHeader ()=default
 
 ResponseHeader (const std::initializer_list< KeyValueType > &initializer_list)
 
void setCode (uint16_t response_code) noexcept
 
uint16_t getCode () const noexcept
 
HttpVersion getVersion () const
 
void setVersion (HttpVersion new_version)
 
- Public Member Functions inherited from sese::net::http::Header
 Header ()=default
 
 Header (const std::initializer_list< KeyValueType > &initializer_list) noexcept
 
virtual ~Header ()=default
 
void set (const std::string &key, const std::string &value) noexcept
 
const std::string & get (const std::string &key, const std::string &default_value) noexcept
 
std::map< std::string, std::string >::iterator begin () noexcept
 
std::map< std::string, std::string >::iterator end () noexcept
 
auto find (const std::string &key) noexcept
 
void clear ()
 
bool empty () const
 
size_t size () const
 
bool exist (const std::string &key)
 
const std::string & get (const std::string &key)
 
const CookieMap::PtrgetCookies () const
 
void setCookies (const CookieMap::Ptr &cookies)
 
Cookie::Ptr getCookie (const std::string &name) const
 
void setCookie (const Cookie::Ptr &cookie)
 

Protected Attributes

uint16_t statusCode = 200
 
HttpVersion version = HttpVersion::VERSION_1_1
 
- Protected Attributes inherited from sese::net::http::Header
StrCaseMap< std::string > headers
 
CookieMap::Ptr cookies = nullptr
 

Detailed Description

Member Typedef Documentation

◆ Ptr

Constructor & Destructor Documentation

◆ ResponseHeader() [1/2]

sese::net::http::ResponseHeader::ResponseHeader ( )
default

◆ ResponseHeader() [2/2]

sese::net::http::ResponseHeader::ResponseHeader ( const std::initializer_list< KeyValueType > & initializer_list)
inline

Member Function Documentation

◆ getCode()

uint16_t sese::net::http::ResponseHeader::getCode ( ) const
inlinenodiscardnoexcept

◆ getVersion()

HttpVersion sese::net::http::ResponseHeader::getVersion ( ) const
inlinenodiscard

References version.

◆ setCode()

void sese::net::http::ResponseHeader::setCode ( uint16_t response_code)
inlinenoexcept

References statusCode.

◆ setVersion()

void sese::net::http::ResponseHeader::setVersion ( HttpVersion new_version)
inline

References version.

Member Data Documentation

◆ statusCode

uint16_t sese::net::http::ResponseHeader::statusCode = 200
protected

Referenced by getCode(), and setCode().

◆ version

HttpVersion sese::net::http::ResponseHeader::version = HttpVersion::VERSION_1_1
protected

Referenced by getVersion(), and setVersion().


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