FastLED 3.9.15
Loading...
Searching...
No Matches
fl::asio::http::Response Class Reference

Detailed Description

HTTP response builder (fluent interface)

Definition at line 95 of file server.h.

#include <server.h>

+ Collaboration diagram for fl::asio::http::Response:

Public Member Functions

 Response () FL_NOEXCEPT
 
Responsebody (const string &content)
 Set response body.
 
Responseheader (const string &name, const string &value)
 Add HTTP header.
 
Responsejson (const class json &data)
 Set JSON response body with automatic Content-Type header.
 
Responsestatus (int code)
 Set HTTP status code.
 

Static Public Member Functions

static Response bad_request (const string &message)
 Factory method for 400 Bad Request response.
 
static Response internal_error (const string &message)
 Factory method for 500 Internal Server Error response.
 
static Response not_found ()
 Factory method for 404 Not Found response.
 
static Response ok (const string &body="")
 Factory method for 200 OK response.
 

Private Member Functions

string to_string () const
 

Private Attributes

string mBody
 
map< string, stringmHeaders
 
int mStatusCode = 200
 

Friends

class Server
 

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