pulsatrix 1.1.0
Loading...
Searching...
No Matches
pulsatrix::orch::HttpTransport Class Referenceabstract

Sends HTTP requests. One instance may be used by one thread at a time. More...

#include <http.hpp>

Public Member Functions

virtual ~HttpTransport ()=default
 
virtual HttpResponse send (const HttpRequest &request)=0
 Sends request and waits for the whole response.
 
virtual HttpResponse stream (const HttpRequest &request, const HttpChunkHandler &on_chunk)=0
 Sends request and passes a successful (2xx) response's body to on_chunk as it arrives, for server-sent events. Any other status's body is collected into HttpResponse::body instead, for the error message.
 
virtual std::string name () const =0
 The backend and its TLS library, for example cpp-httplib 0.57.1 (OpenSSL 3.5.5).
 

Detailed Description

Sends HTTP requests. One instance may be used by one thread at a time.

Constructor & Destructor Documentation

◆ ~HttpTransport()

virtual pulsatrix::orch::HttpTransport::~HttpTransport ( )
virtualdefault

Member Function Documentation

◆ name()

virtual std::string pulsatrix::orch::HttpTransport::name ( ) const
pure virtual

The backend and its TLS library, for example cpp-httplib 0.57.1 (OpenSSL 3.5.5).

◆ send()

virtual HttpResponse pulsatrix::orch::HttpTransport::send ( const HttpRequest &  request)
pure virtual

Sends request and waits for the whole response.

Exceptions
HttpErrorif no complete response arrived.

◆ stream()

virtual HttpResponse pulsatrix::orch::HttpTransport::stream ( const HttpRequest &  request,
const HttpChunkHandler &  on_chunk 
)
pure virtual

Sends request and passes a successful (2xx) response's body to on_chunk as it arrives, for server-sent events. Any other status's body is collected into HttpResponse::body instead, for the error message.

Note
If on_chunk returns false the request is cancelled, and stream() returns normally with what had arrived.
Exceptions
HttpErrorif no complete response arrived.

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