A Discrete-Event Network Simulator
API
http::Request Class Referencefinal

#include "http-request.h"

+ Collaboration diagram for http::Request:

Public Member Functions

 Request (const std::string &url, InternetProtocol protocol=InternetProtocol::V4)
 
Response send (const std::string &method, const std::map< std::string, std::string > &parameters, const std::vector< std::string > &headers={})
 
Response send (const std::string &method, const std::vector< uint8_t > &body, const std::vector< std::string > &headers)
 
Response send (const std::string &method="GET", const std::string &body="", const std::vector< std::string > &headers={})
 

Private Attributes

std::string domain
 
InternetProtocol internetProtocol
 
std::string path
 
std::string port
 
std::string scheme
 

Detailed Description

Definition at line 173 of file http-request.h.

Constructor & Destructor Documentation

◆ Request()

http::Request::Request ( const std::string &  url,
InternetProtocol  protocol = InternetProtocol::V4 
)
inlineexplicit

Definition at line 176 of file http-request.h.

References domain, path, port, and scheme.

Member Function Documentation

◆ send() [1/3]

Response http::Request::send ( const std::string &  method,
const std::map< std::string, std::string > &  parameters,
const std::vector< std::string > &  headers = {} 
)
inline

Definition at line 223 of file http-request.h.

◆ send() [2/3]

Response http::Request::send ( const std::string &  method,
const std::vector< uint8_t > &  body,
const std::vector< std::string > &  headers 
)
inline

Definition at line 250 of file http-request.h.

References http::Response::body, domain, http::Response::headers, internetProtocol, min, path, port, scheme, http::Response::status, and nlohmann::to_string().

+ Here is the call graph for this function:

◆ send() [3/3]

Response http::Request::send ( const std::string &  method = "GET",
const std::string &  body = "",
const std::vector< std::string > &  headers = {} 
)
inline

Definition at line 241 of file http-request.h.

Member Data Documentation

◆ domain

std::string http::Request::domain
private

Definition at line 465 of file http-request.h.

Referenced by Request(), and send().

◆ internetProtocol

InternetProtocol http::Request::internetProtocol
private

Definition at line 463 of file http-request.h.

Referenced by send().

◆ path

std::string http::Request::path
private

Definition at line 467 of file http-request.h.

Referenced by Request(), and send().

◆ port

std::string http::Request::port
private

Definition at line 466 of file http-request.h.

Referenced by Request(), and send().

◆ scheme

std::string http::Request::scheme
private

Definition at line 464 of file http-request.h.

Referenced by Request(), and send().


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