Thoth
A functional, expressive, asynchronous C++26 webdev library
Loading...
Searching...
No Matches
Thoth::Http::Response< Method, Body > Struct Template Reference

#include <Response.hpp>

Public Types

using MethodType = Method
 

Public Member Functions

template<class = void>
requires std::same_as<Body, string>
std::expected< NJson::Json, RequestErrorAsJson () const
 
bool Successful () const
 Returns if the response is 2XX.
 
Body MoveBody () &&
 Monad friendly move of the body, discarding the rest of the response. Recommended check for Successful() before.
 

Public Attributes

VersionEnum version {}
 
StatusCodeEnum status {}
 
string statusMessage {}
 
ResponseHeaders headers {}
 
Body body
 

Friends

struct Client
 

Member Typedef Documentation

◆ MethodType

template<MethodConcept Method = GetMethod, ResponseBodyConcept Body = std::string>
using Thoth::Http::Response< Method, Body >::MethodType = Method

Member Function Documentation

◆ AsJson()

template<MethodConcept Method = GetMethod, ResponseBodyConcept Body = std::string>
template<class = void>
requires std::same_as<Body, string>
std::expected< NJson::Json, RequestError > Thoth::Http::Response< Method, Body >::AsJson ( ) const

◆ MoveBody()

template<MethodConcept Method = GetMethod, ResponseBodyConcept Body = std::string>
Body Thoth::Http::Response< Method, Body >::MoveBody ( ) &&

Monad friendly move of the body, discarding the rest of the response. Recommended check for Successful() before.

◆ Successful()

template<MethodConcept Method = GetMethod, ResponseBodyConcept Body = std::string>
bool Thoth::Http::Response< Method, Body >::Successful ( ) const

Returns if the response is 2XX.

Friends And Related Symbol Documentation

◆ Client

template<MethodConcept Method = GetMethod, ResponseBodyConcept Body = std::string>
friend struct Client
friend

Member Data Documentation

◆ body

template<MethodConcept Method = GetMethod, ResponseBodyConcept Body = std::string>
Body Thoth::Http::Response< Method, Body >::body

◆ headers

template<MethodConcept Method = GetMethod, ResponseBodyConcept Body = std::string>
ResponseHeaders Thoth::Http::Response< Method, Body >::headers {}

◆ status

template<MethodConcept Method = GetMethod, ResponseBodyConcept Body = std::string>
StatusCodeEnum Thoth::Http::Response< Method, Body >::status {}

◆ statusMessage

template<MethodConcept Method = GetMethod, ResponseBodyConcept Body = std::string>
string Thoth::Http::Response< Method, Body >::statusMessage {}

◆ version

template<MethodConcept Method = GetMethod, ResponseBodyConcept Body = std::string>
VersionEnum Thoth::Http::Response< Method, Body >::version {}

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