PIP 6.1.0
Platform-Independent Primitives
Loading...
Searching...
No Matches
PIHTTPClient Class Reference

Asynchronous HTTP client request with completion callbacks. More...

#include <pihttpclient.h>

Public Member Functions

PIHTTPClient * onFinish (std::function< void()> f)
 Sets a callback invoked when the transfer completes successfully.
PIHTTPClient * onFinish (std::function< void(const PIHTTP::MessageConst &)> f)
 Sets a callback invoked when the transfer completes successfully and provides the parsed reply.
PIHTTPClient * onError (std::function< void()> f)
 Sets a callback invoked when the transfer fails with a transport-level error.
PIHTTPClient * onError (std::function< void(const PIHTTP::MessageConst &)> f)
 Sets a callback invoked when the transfer fails with a transport-level error and provides the partial reply state.
PIHTTPClient * onAbort (std::function< void()> f)
 Sets a callback invoked when the request is aborted.
PIHTTPClient * onAbort (std::function< void(const PIHTTP::MessageConst &)> f)
 Sets a callback invoked when the request is aborted and provides the current reply state.
PIHTTPClient * ignoreSSLErrors ()
 Disables SSL verification checks for this request. Call before start().
void start ()
 Queues the request for asynchronous execution.
void abort ()
 Requests cancellation of the running transfer.
PIString lastError () const
 Returns the last transport error message.

Static Public Member Functions

static PIHTTPClient * create (const PIString &url, PIHTTP::Method method=PIHTTP::Method::Get, const PIHTTP::MessageConst &req={})
 Creates a request object for the specified URL, method and initial message data.

Detailed Description

Asynchronous HTTP client request with completion callbacks.