12#include "StripeKit/Async.h"
13#include "StripeKit/RequestOptions.h"
18#include <unordered_map>
59 std::unordered_map<std::string, std::string>
headers;
87 std::unordered_map<std::string, std::string>
headers;
113 using Completion = std::function<void(std::variant<HttpResponse, std::exception_ptr>)>;
Sends StripeKit's requests to Stripe.
virtual void send(const HttpRequest &request, Completion completion)=0
Sends a request to Stripe, reporting the result through a callback.
std::function< void(std::variant< HttpResponse, std::exception_ptr >)> Completion
Completion callback for the callback form of send().
virtual ~HTTPClient()=default
Destroys the HTTP client instance.
virtual Task< HttpResponse > send_async(const HttpRequest &request)=0
Sends a request to Stripe.
The result of an asynchronous StripeKit operation.
HttpMethod
HTTP method for a Stripe API request.
@ Post
Create or update an object.
@ Delete
Remove an object.
A request StripeKit wants sent to Stripe.
HttpMethod method
Method to use.
std::string path
Path relative to the Stripe API base URL, for example "/v1/customers".
std::unordered_map< std::string, std::string > headers
Headers StripeKit needs sent.
RequestOptions options
Per-call settings the adapter must honour.
std::string body
The request body, already encoded as "application/x-www-form-urlencoded".
Stripe's answer to a request.
std::string body
Response body, unmodified.
int status_code
HTTP status Stripe returned.
std::unordered_map< std::string, std::string > headers
Response headers, with lower-case keys.
Per-call settings accepted by every client operation.