30#ifndef PT_JSONRPC_HTTPCLIENT_H
31#define PT_JSONRPC_HTTPCLIENT_H
33#include <Pt/JsonRpc/Api.h>
34#include <Pt/JsonRpc/Client.h>
35#include <Pt/Http/Client.h>
36#include <Pt/Connectable.h>
65 const std::string& url);
102 const std::string& url);
148 void setError(
bool f =
true)
Connectable()
Default constructor.
HTTP user agent.
Definition Client.h:189
HTTP reply message.
Definition Reply.h:64
HTTP request message.
Definition Request.h:65
void setSecure(Ssl::Context &ctx)
Sets SSL context.
const Net::Endpoint & host() const
Returns target host.
void setKeepAlive()
Enables HTTP keep-alive.
HttpClient(System::EventLoop &loop, const Net::Endpoint &ep, const std::string &url)
Construct with host and service URL.
void setTarget(const Net::Endpoint &ep, const std::string &url)
Sets target host and service URL.
void setTarget(const Net::Endpoint &ep, const Net::TcpSocketOptions &opts, const std::string &url)
Sets target host and service URL.
virtual void onCancel()
Cancels the remote procedure call.
HttpClient(System::EventLoop &loop)
Construct with EventLoop used for I/O.
void setTimeout(std::size_t timeout)
Sets timeout for I/O operations.
virtual void onBeginInvoke()
Begin an asynchronous invocation.
void close()
Closes the connection.
void setHost(const Net::Endpoint &ep)
Sets host to connect.
void setServiceUrl(const std::string &url)
Sets the service URL.
void setServiceUrl(const char *url)
Sets the service URL.
virtual bool isFailed() const
Indicates if the procedure has failed.
HttpClient(const Net::Endpoint &ep, const std::string &url)
Construct with host and service URL.
virtual void onInvoke()
Perform a synchronous invocation.
System::EventLoop * loop() const
Gets the used EventLoop.
void setActive(System::EventLoop &loop)
Sets the EventLoop to use for I/O.
virtual void onEndInvoke()
End an asynchronous invocation.
virtual ~HttpClient()
Destructor.
void setHost(const Net::Endpoint &ep, const Net::TcpSocketOptions &opts)
Sets host to connect.
void setPeerName(const std::string &peer)
Set expected SSL peer name.
Host and service address.
Definition Endpoint.h:77
TCP socket connection options.
Definition TcpSocket.h:51
Shared configuration for SSL connections.
Definition Context.h:113
Event loop of a thread or process.
Definition EventLoop.h:83
JSON-RPC 2.0 services and clients.
Core module.
Definition Allocator.h:33