C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::net::http::responder::promise Class Reference

Allows users to respond to an incoming HTTP request at some later time. More...

#include <responder.hpp>

Public Member Functions

 promise (responder &parent)
 
 promise (const promise &) noexcept=default
 
promiseoperator= (const promise &) noexcept=default
 
void respond (status code)
 Sends an HTTP response that only consists of a header with a status code such as status::no_content.
 
void respond (status code, std::string_view content_type, const_byte_span content)
 Sends an HTTP response message to the client.
 
void respond (status code, std::string_view content_type, std::string_view content)
 Sends an HTTP response message to the client.
 
void respond (status code, const error &what)
 Sends an HTTP response message with an error to the client.
 
lower_layer::server * down ()
 Returns a pointer to the HTTP layer.
 

Detailed Description

Allows users to respond to an incoming HTTP request at some later time.

Member Function Documentation

◆ respond() [1/3]

void caf::net::http::responder::promise::respond ( status code,
const error & what )

Sends an HTTP response message with an error to the client.

Converts what to a string representation and then transfers this description to the client.

◆ respond() [2/3]

void caf::net::http::responder::promise::respond ( status code,
std::string_view content_type,
const_byte_span content )

Sends an HTTP response message to the client.

Automatically sets the Content-Type and Content-Length header fields.

◆ respond() [3/3]

void caf::net::http::responder::promise::respond ( status code,
std::string_view content_type,
std::string_view content )

Sends an HTTP response message to the client.

Automatically sets the Content-Type and Content-Length header fields.


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