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

#include <Request.hpp>

Public Types

using MethodType = Method
 

Static Public Member Functions

template<class T = string_view>
requires Hermes::ByteLike<std::ranges::range_value_t<T>> || (std::same_as<Body, std::string> && requires (T t) { { std::format("{}", t) }; })
static std::expected< Request, RequestErrorFromUrl (string_view url, T &&body={}, Headers headers=Headers::DefaultHeaders())
 Try parse to a URL before construct the Request.
 

Public Attributes

Url url
 
Body body
 
VersionEnum version { VersionEnum::HTTP1_1 }
 
RequestHeaders headers { Headers::DefaultHeaders() }
 

Member Typedef Documentation

◆ MethodType

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

Member Function Documentation

◆ FromUrl()

template<MethodConcept Method = GetMethod, RequestBodyConcept Body = std::string>
template<class T = string_view>
requires Hermes::ByteLike<std::ranges::range_value_t<T>> || (std::same_as<Body, std::string> && requires (T t) { { std::format("{}", t) }; })
static std::expected< Request, RequestError > Thoth::Http::Request< Method, Body >::FromUrl ( string_view  url,
T &&  body = {},
Headers  headers = Headers::DefaultHeaders() 
)
static

Try parse to a URL before construct the Request.

Member Data Documentation

◆ body

template<MethodConcept Method = GetMethod, RequestBodyConcept Body = std::string>
Body Thoth::Http::Request< Method, Body >::body

◆ headers

template<MethodConcept Method = GetMethod, RequestBodyConcept Body = std::string>
RequestHeaders Thoth::Http::Request< Method, Body >::headers { Headers::DefaultHeaders() }

◆ url

template<MethodConcept Method = GetMethod, RequestBodyConcept Body = std::string>
Url Thoth::Http::Request< Method, Body >::url

◆ version

template<MethodConcept Method = GetMethod, RequestBodyConcept Body = std::string>
VersionEnum Thoth::Http::Request< Method, Body >::version { VersionEnum::HTTP1_1 }

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