ENTS-tock
Environmental NeTworked Sensor firmware on Tock OS
Loading...
Searching...
No Matches
HttpClient Class Reference

HTTP request parser library. More...

#include <dirtviz/include/http.hpp>

Public Member Functions

 HttpClient ()
 Default constructor.
 
 HttpClient (const std::string &resp)
 Default constructor.
 
 ~HttpClient ()
 Default destructor.
 
std::string Version ()
 Get the Http version.
 
unsigned int ResponseCode ()
 Get the http response code.
 
std::string Header (std::string header)
 Get value of header.
 
std::string Data ()
 Get data from Http request.
 

Detailed Description

HTTP request parser library.

Author
John Madden jmadd.nosp@m.en17.nosp@m.3@pm..nosp@m.me
Date
2023-11-29

HTTP request parser library

This library is used to parse HTTP requests and responses.

Examples:

Definition at line 28 of file http.hpp.

Constructor & Destructor Documentation

◆ HttpClient() [1/2]

HttpClient::HttpClient ( )

Default constructor.

Create an empty object

Definition at line 8 of file http.cpp.

◆ HttpClient() [2/2]

HttpClient::HttpClient ( const std::string &  resp)
explicit

Default constructor.

Parameters
Httpresponse string

Definition at line 10 of file http.cpp.

◆ ~HttpClient()

HttpClient::~HttpClient ( )

Default destructor.

Definition at line 27 of file http.cpp.

Member Function Documentation

◆ Data()

std::string HttpClient::Data ( )

Get data from Http request.

Returns
String of data

Definition at line 35 of file http.cpp.

Referenced by loop(), setup(), and TestHttpClient().

◆ Header()

std::string HttpClient::Header ( std::string  header)

Get value of header.

Parameters
headerRequested header
Returns
Value of header

Definition at line 33 of file http.cpp.

Referenced by setup(), and TestHttpClient().

◆ ResponseCode()

unsigned int HttpClient::ResponseCode ( )

Get the http response code.

Returns
Http response code

Definition at line 31 of file http.cpp.

Referenced by loop(), setup(), and TestHttpClient().

◆ Version()

std::string HttpClient::Version ( )

Get the Http version.

Example return value "Http/1.1"

@retrun Http version

Definition at line 29 of file http.cpp.

Referenced by setup(), and TestHttpClient().


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