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

Implicitly shared handle type that represents an HTTP client request with a promise for the HTTP response. More...

#include <request.hpp>

Public Member Functions

 request (request &&other) noexcept
 
 request (const request &other) noexcept
 
requestoperator= (request &&other) noexcept
 
requestoperator= (const request &other) noexcept
 
const request_headerheader () const
 Returns the HTTP header for the request.
 
const_byte_span body () const
 Returns the HTTP body (payload) for the request.
 
const_byte_span payload () const
 Returns the HTTP body (payload) for the request.
 
void respond (status code, std::string_view content_type, const_byte_span content) const
 Sends an HTTP response message to the client.
 
void respond (status code, std::string_view content_type, std::string_view content) const
 Sends an HTTP response message to the client.
 

Friends

class router
 

Detailed Description

Implicitly shared handle type that represents an HTTP client request with a promise for the HTTP response.

Member Function Documentation

◆ body()

const_byte_span caf::net::http::request::body ( ) const

Returns the HTTP body (payload) for the request.

Precondition
valid()

◆ header()

const request_header & caf::net::http::request::header ( ) const

Returns the HTTP header for the request.

Precondition
valid()

◆ payload()

const_byte_span caf::net::http::request::payload ( ) const

Returns the HTTP body (payload) for the request.

Precondition
valid()

◆ respond() [1/2]

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

Sends an HTTP response message to the client.

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

Precondition
valid()

◆ respond() [2/2]

void caf::net::http::request::respond ( status code,
std::string_view content_type,
std::string_view content ) const

Sends an HTTP response message to the client.

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

Precondition
valid()

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