|
pulsatrix 1.1.0
|
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). | |
Sends HTTP requests. One instance may be used by one thread at a time.
|
virtualdefault |
|
pure virtual |
The backend and its TLS library, for example cpp-httplib 0.57.1 (OpenSSL 3.5.5).
|
pure virtual |
Sends request and waits for the whole response.
| HttpError | if no complete response arrived. |
|
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.
on_chunk returns false the request is cancelled, and stream() returns normally with what had arrived. | HttpError | if no complete response arrived. |