pulsatrix 1.1.0
Loading...
Searching...
No Matches
http.hpp File Reference

HTTP for the orchestrator: requests, responses and a transport with two backends. More...

#include <chrono>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <memory>
#include <stdexcept>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include "pulsatrix/orch/secret.hpp"
Include dependency graph for http.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pulsatrix::orch::HttpHeader
 One request header. A sensitive one (a credential) is redacted by HttpRequest::describe(). More...
 
struct  pulsatrix::orch::HttpRequest
 An HTTP request. Redirects are never followed, so a credential only goes to url. More...
 
struct  pulsatrix::orch::HttpResponse
 An HTTP response. A status of 400 or 500 is a response, not an error. More...
 
class  pulsatrix::orch::HttpError
 A request that got no complete response: the connection, TLS, a timeout or a limit failed. More...
 
class  pulsatrix::orch::HttpTransport
 Sends HTTP requests. One instance may be used by one thread at a time. More...
 
struct  pulsatrix::orch::HttpTransportOptions
 How a transport trusts servers. Certificate verification can't be turned off. More...
 
struct  pulsatrix::orch::HttpUrl
 An http or https URL split into its parts. More...
 

Namespaces

namespace  pulsatrix
 
namespace  pulsatrix::orch
 

Typedefs

using pulsatrix::orch::HttpChunkHandler = std::function< bool(std::string_view chunk)>
 Receives a streamed body chunk by chunk. Return false to cancel the request.
 

Enumerations

enum class  pulsatrix::orch::HttpBackend { pulsatrix::orch::Httplib , pulsatrix::orch::Curl }
 The HTTP libraries a transport can use. More...
 

Functions

bool pulsatrix::orch::HttpBackendAvailable (HttpBackend backend)
 Whether this build has backend.
 
bool pulsatrix::orch::HttpsSupported (HttpBackend backend)
 Whether backend can make HTTPS requests in this build.
 
std::unique_ptr< HttpTransport > pulsatrix::orch::MakeHttpTransport (HttpBackend backend, HttpTransportOptions options={})
 A transport using backend.
 
std::unique_ptr< HttpTransport > pulsatrix::orch::MakeHttpTransport (HttpTransportOptions options={})
 A transport using libcurl if this build has it, which you asked for by turning it on, and cpp-httplib otherwise.
 
HttpUrl pulsatrix::orch::ParseHttpUrl (std::string_view url)
 Parses an http:// or https:// URL.
 

Detailed Description

HTTP for the orchestrator: requests, responses and a transport with two backends.