StormByte-Network 4.0.0
C++26 networking module of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Network::HTTP::Request Struct Reference

Fully buffered request. More...

#include <StormByte/network/http/client.hxx>

Collaboration diagram for StormByte::Network::HTTP::Request:

Public Member Functions

 Request (std::string_view url={})
 Construct a GET request for a borrowed absolute URL.
 Request (const Request &other)
 Independently copy the request.
 Request (Request &&other) noexcept
 Transfer request ownership.
 ~Request () noexcept
 Release all provider-owned fields.
Request & operator= (const Request &other)
 Independently replace the request.
Request & operator= (Request &&other) noexcept
 Transfer request ownership.

Public Attributes

Safe::String url
 Absolute ASCII URL; fragments are rejected.
Safe::String method
 Case-sensitive method token; defaults to GET.
Safe::Vector< Header > headers
 Ordered duplicate-preserving user headers.
Safe::Binary body
 Byte-exact request body, including NUL bytes.

Detailed Description

Fully buffered request.

Host, framing and connection headers are owned by the client; CONNECT, Upgrade and Expect are not supported.

Lifecycle executes in Network; copies are independent, moved values have empty owning fields and can be reassigned.

Constructor & Destructor Documentation

◆ Request() [1/3]

StormByte::Network::HTTP::Request::Request ( std::string_view url = {})
explicit

Construct a GET request for a borrowed absolute URL.

Parameters
urlAbsolute http or https URL.
Exceptions
StormByte::Safe::AllocationErrorRequest text cannot be allocated.

◆ Request() [2/3]

StormByte::Network::HTTP::Request::Request ( const Request & other)

Independently copy the request.

Parameters
otherSource request.

◆ Request() [3/3]

StormByte::Network::HTTP::Request::Request ( Request && other)
noexcept

Transfer request ownership.

Parameters
otherSource request.

◆ ~Request()

StormByte::Network::HTTP::Request::~Request ( )
noexcept

Release all provider-owned fields.

Member Function Documentation

◆ operator=() [1/2]

Request & StormByte::Network::HTTP::Request::operator= ( const Request & other)

Independently replace the request.

Parameters
otherSource request.
Returns
This request.

◆ operator=() [2/2]

Request & StormByte::Network::HTTP::Request::operator= ( Request && other)
noexcept

Transfer request ownership.

Parameters
otherSource request.
Returns
This request.

Member Data Documentation

◆ body

Safe::Binary StormByte::Network::HTTP::Request::body

Byte-exact request body, including NUL bytes.

◆ headers

Safe::Vector<Header> StormByte::Network::HTTP::Request::headers

Ordered duplicate-preserving user headers.

◆ method

Safe::String StormByte::Network::HTTP::Request::method

Case-sensitive method token; defaults to GET.

◆ url

Safe::String StormByte::Network::HTTP::Request::url

Absolute ASCII URL; fragments are rejected.


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