Public Member Functions | List of all members
HttpsClient Class Reference

A simple HTTPS client. More...

#include <HttpsClient.hpp>

Inheritance diagram for HttpsClient:
[legend]
Collaboration diagram for HttpsClient:
[legend]

Public Member Functions

 HttpsClient (std::string host_, unsigned short port_=443, std::string userAgent_="Balau "+BalauVersion, const char *version_="1.1")
 Create an HTTPS client instance. More...
 
 HttpsClient (const HttpsClient &)=default
 Create an HTTPS client by copying the supplied instance. More...
 
 HttpsClient (HttpsClient &&)=default
 Create an HTTPS client by moving the contents of the supplied instance. More...
 
CharVectorResponse get (const std::string_view &path) override
 Perform a GET request. More...
 
EmptyResponse head (const std::string_view &path) override
 Perform a HEAD request. More...
 
HttpsClientoperator= (const HttpsClient &)=default
 Assign an HTTPS client by copying the supplied instance. More...
 
HttpsClientoperator= (HttpsClient &&)=default
 Assign an HTTPS client by moving the contents of the supplied instance. More...
 
CharVectorResponse post (const std::string_view &path, const std::string_view &body) override
 Perform a POST request. More...
 
- Public Member Functions inherited from HttpClient
 HttpClient (std::string host_, unsigned short port_=80, std::string userAgent_="Balau "+BalauVersion, const char *version_="1.1")
 Create an HTTP client instance. More...
 
 HttpClient (const HttpClient &)=default
 Create an HTTP client by copying the supplied instance. More...
 
 HttpClient (HttpClient &&)=default
 Create an HTTP client by moving the contents of the supplied instance. More...
 
virtual ~HttpClient ()=default
 Destroy the client instance. More...
 
HttpClientoperator= (const HttpClient &)=default
 Assign an HTTP client by copying the supplied instance. More...
 
HttpClientoperator= (HttpClient &&)=default
 Assign an HTTP client by moving the contents of the supplied instance. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from HttpClient
static std::unique_ptr< HttpClientnewClient (const Resource::Url &url, std::string userAgent="Balau "+BalauVersion, const char *version="1.1")
 Create a new HTTP or HTTPS client, according to the supplied URL. More...
 
static std::unique_ptr< HttpClientnewClient (const std::string &url, std::string userAgent="Balau "+BalauVersion, const char *version="1.1")
 Create a new HTTP or HTTPS client, according to the supplied URL string. More...
 

Detailed Description

A simple HTTPS client.

The HTTPS client derives from the HTTP client in order to allow polymorphic usage via a pointer container.

Todo:
Add chunked transfer.

Constructor & Destructor Documentation

◆ HttpsClient() [1/3]

HttpsClient ( std::string  host_,
unsigned short  port_ = 443,
std::string  userAgent_ = "Balau " + BalauVersion,
const char *  version_ = "1.1" 
)
inlineexplicit

Create an HTTPS client instance.

Parameters
host_the host name to connect to
port_the port number to connect to
version_either "1.0" or "1.1" (the default)
userAgent_the user agent string to send

◆ HttpsClient() [2/3]

HttpsClient ( const HttpsClient )
default

Create an HTTPS client by copying the supplied instance.

◆ HttpsClient() [3/3]

HttpsClient ( HttpsClient &&  )
default

Create an HTTPS client by moving the contents of the supplied instance.

Member Function Documentation

◆ get()

CharVectorResponse get ( const std::string_view &  path)
inlineoverridevirtual

Perform a GET request.

Reimplemented from HttpClient.

◆ head()

EmptyResponse head ( const std::string_view &  path)
inlineoverridevirtual

Perform a HEAD request.

Reimplemented from HttpClient.

◆ operator=() [1/2]

HttpsClient& operator= ( const HttpsClient )
default

Assign an HTTPS client by copying the supplied instance.

◆ operator=() [2/2]

HttpsClient& operator= ( HttpsClient &&  )
default

Assign an HTTPS client by moving the contents of the supplied instance.

◆ post()

CharVectorResponse post ( const std::string_view &  path,
const std::string_view &  body 
)
inlineoverridevirtual

Perform a POST request.

Reimplemented from HttpClient.


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