AnCH Framework 0.1
Another C++ Hack Framework
Loading...
Searching...
No Matches
anch::rest::Response::Builder Class Reference

HTTP response builder. More...

#include <response.hpp>

Collaboration diagram for anch::rest::Response::Builder:

Public Member Functions

 Builder ()
 Builder (Builder &&builder)
virtual ~Builder ()
Builder status (uint16_t code)
Builder header (const std::string &name, const std::string &value)
Builder header (const std::string &name, const std::vector< std::string > &values)
Builder headers (const anch::rest::Headers &headers)
Builder contentType (const std::string &contentType)
Builder body (const std::string &body)
Builder body (const char *const body)
template<typename T>
Builder body (T body)
Response build ()

Detailed Description

HTTP response builder.

HTTP Response builder

Author
Vincent Lachenal
Since
0.1

Constructor & Destructor Documentation

◆ Builder() [1/2]

anch::rest::Response::Builder::Builder ( )

Builder default constructor

◆ Builder() [2/2]

anch::rest::Response::Builder::Builder ( Builder && builder)

Builder move constructor

Parameters
builderthe builder to move
Here is the call graph for this function:

◆ ~Builder()

virtual anch::rest::Response::Builder::~Builder ( )
virtual

Builder destructor

Member Function Documentation

◆ body() [1/3]

Builder anch::rest::Response::Builder::body ( const char *const body)

Body setter

Parameters
bodythe body to set
Here is the call graph for this function:

◆ body() [2/3]

Builder anch::rest::Response::Builder::body ( const std::string & body)

Body setter

Parameters
bodythe body to set
Here is the call graph for this function:

◆ body() [3/3]

template<typename T>
Builder anch::rest::Response::Builder::body ( T body)

Body setter

Parameters
bodythe body to set
Returns
this
Here is the call graph for this function:

◆ build()

Response anch::rest::Response::Builder::build ( )

Finalize builder and return the HTTP Response

Returns
the HTTP response
Here is the call graph for this function:

◆ contentType()

Builder anch::rest::Response::Builder::contentType ( const std::string & contentType)

Media type setter

Parameters
contentTypethe media type to set
Returns
this
Here is the call graph for this function:

◆ header() [1/2]

Builder anch::rest::Response::Builder::header ( const std::string & name,
const std::string & value )

Add header when it does not exist

Parameters
namethe header's name
valuethe header's value
Returns
this
Here is the call graph for this function:

◆ header() [2/2]

Builder anch::rest::Response::Builder::header ( const std::string & name,
const std::vector< std::string > & values )

Add header when it does not exist

Parameters
namethe header's name
valuesthe header's values
Returns
this
Here is the call graph for this function:

◆ headers()

Builder anch::rest::Response::Builder::headers ( const anch::rest::Headers & headers)

Set headers.
This method overrides all headers previsouly defined

Parameters
headersthe headers to set
Returns
this
Here is the call graph for this function:

◆ status()

Builder anch::rest::Response::Builder::status ( uint16_t code)

Status setter

Parameters
codethe status code to set
Returns
this
Here is the call graph for this function:

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