neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
neolib::http Class Reference

#include <http.hpp>

Public Types

enum  type_e { Get , Post }
 
typedef std::map< ci_string, std::string > headers_t
 
typedef std::vector< charbody_t
 

Public Member Functions

 define_event (Started, started) define_event(Progress
 
progress define_event (Completed, completed) define_event(Failure
 
 http (async_task &aIoTask)
 
 http (const http &aOther)
 
virtual ~http ()
 
httpoperator= (const http &aOther)
 
bool operator== (const http &) const
 
void request (const std::string &aUrl, type_e aType=Get, const headers_t &aRequestHeaders=headers_t(), const std::variant< body_t, std::string > &aRequestBody=std::string())
 
void request (const std::string &aHost, const std::string &aResource, type_e aType=Get, unsigned short aPort=80, bool aSecure=false, const headers_t &aRequestHeaders=headers_t(), const std::variant< body_t, std::string > &aRequestBody=std::string())
 
bool ok () const
 
uint32_t status_code () const
 
uint64_t body_length () const
 
const std::string & response_status () const
 
const headers_tresponse_headers () const
 
const body_tbody () const
 
std::string body_as_string () const
 
double percent_done () const
 

Detailed Description

Definition at line 70 of file http.hpp.

Member Typedef Documentation

◆ body_t

Definition at line 82 of file http.hpp.

◆ headers_t

typedef std::map<ci_string, std::string> neolib::http::headers_t

Definition at line 81 of file http.hpp.

Member Enumeration Documentation

◆ type_e

Enumerator
Get 
Post 

Definition at line 83 of file http.hpp.

Constructor & Destructor Documentation

◆ http() [1/2]

neolib::http::http ( async_task aIoTask)

◆ http() [2/2]

neolib::http::http ( const http aOther)

◆ ~http()

virtual neolib::http::~http ( )
virtual

Member Function Documentation

◆ body()

const body_t & neolib::http::body ( ) const
inline

Definition at line 102 of file http.hpp.

◆ body_as_string()

std::string neolib::http::body_as_string ( ) const
inline

Definition at line 103 of file http.hpp.

◆ body_length()

uint64_t neolib::http::body_length ( ) const
inline

Definition at line 99 of file http.hpp.

◆ define_event() [1/2]

progress neolib::http::define_event ( Completed  ,
completed   
)

◆ define_event() [2/2]

neolib::http::define_event ( Started  ,
started   
)

◆ ok()

bool neolib::http::ok ( ) const
inline

Definition at line 97 of file http.hpp.

◆ operator=()

http & neolib::http::operator= ( const http aOther)

◆ operator==()

bool neolib::http::operator== ( const http ) const
inline

Definition at line 91 of file http.hpp.

◆ percent_done()

double neolib::http::percent_done ( ) const

◆ request() [1/2]

void neolib::http::request ( const std::string &  aHost,
const std::string &  aResource,
type_e  aType = Get,
unsigned short  aPort = 80,
bool  aSecure = false,
const headers_t aRequestHeaders = headers_t(),
const std::variant< body_t, std::string > &  aRequestBody = std::string() 
)

◆ request() [2/2]

void neolib::http::request ( const std::string &  aUrl,
type_e  aType = Get,
const headers_t aRequestHeaders = headers_t(),
const std::variant< body_t, std::string > &  aRequestBody = std::string() 
)

◆ response_headers()

const headers_t & neolib::http::response_headers ( ) const
inline

Definition at line 101 of file http.hpp.

◆ response_status()

const std::string & neolib::http::response_status ( ) const
inline

Definition at line 100 of file http.hpp.

◆ status_code()

uint32_t neolib::http::status_code ( ) const
inline

Definition at line 98 of file http.hpp.


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