SW Task Event Loop Framework v1.0.0
High-performance C++ asynchronous event loop framework with timer management and promise-based programming
Loading...
Searching...
No Matches
sw_task::net::HttpRequest Struct Reference

#include <HttpService.h>

Collaboration diagram for sw_task::net::HttpRequest:
Collaboration graph

Public Types

using CompleteFn = std::function< void(const HttpResponse &)>
 
using ProgressFn = std::function< void(std::size_t, std::size_t)>
 

Public Member Functions

void addHeader (std::string name, std::string value)
 

Public Attributes

HttpMethod method {HttpMethod::Get}
 
std::string url
 
std::vector< std::pair< std::string, std::string > > headers
 
std::string body
 
uint32_t timeoutMs {0}
 
CompleteFn onComplete
 
ProgressFn onProgress
 

Detailed Description

Definition at line 48 of file HttpService.h.

Member Typedef Documentation

◆ CompleteFn

using sw_task::net::HttpRequest::CompleteFn = std::function<void(const HttpResponse&)>

Definition at line 49 of file HttpService.h.

◆ ProgressFn

using sw_task::net::HttpRequest::ProgressFn = std::function<void(std::size_t, std::size_t)>

Definition at line 50 of file HttpService.h.

Member Function Documentation

◆ addHeader()

void sw_task::net::HttpRequest::addHeader ( std::string  name,
std::string  value 
)
inline

Definition at line 60 of file HttpService.h.

References headers.

Member Data Documentation

◆ body

std::string sw_task::net::HttpRequest::body

Definition at line 55 of file HttpService.h.

◆ headers

std::vector<std::pair<std::string,std::string> > sw_task::net::HttpRequest::headers

Definition at line 54 of file HttpService.h.

Referenced by addHeader().

◆ method

HttpMethod sw_task::net::HttpRequest::method {HttpMethod::Get}

Definition at line 52 of file HttpService.h.

◆ onComplete

CompleteFn sw_task::net::HttpRequest::onComplete

Definition at line 57 of file HttpService.h.

◆ onProgress

ProgressFn sw_task::net::HttpRequest::onProgress

Definition at line 58 of file HttpService.h.

◆ timeoutMs

uint32_t sw_task::net::HttpRequest::timeoutMs {0}

Definition at line 56 of file HttpService.h.

◆ url

std::string sw_task::net::HttpRequest::url

Definition at line 53 of file HttpService.h.


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