29#ifndef Pt_Http_Client_h
30#define Pt_Http_Client_h
32#include <Pt/Http/Api.h>
34#include <Pt/NonCopyable.h>
294 void send(
bool finished =
true);
302 void onRequestSent(
Request& r);
305 void onReplyReceived(
Reply& r);
312 class ClientImpl* _impl;
Connectable()
Default constructor.
const Reply & reply() const
Returns the received reply.
Reply & reply()
Returns the received reply.
void setSecure(Ssl::Context &ctx)
Enables HTTPS with ctx.
const Net::Endpoint & host() const
Returns the host to connect to.
Request & request()
Returns the request to send.
void setTimeout(std::size_t timeout)
Set timeout for I/O operations.
void beginSend(bool finished=true)
Begins sending the request.
const Request & request() const
Returns the request to send.
void close()
Closes the connection and cancels all operations.
Signal< Client & > & requestSent()
Signals that a part of the request was sent.
void setHost(const Net::Endpoint &ep)
Sets the host to connect to.
Client(const Net::Endpoint &ep)
Construct with host to connect to.
void beginReceive()
Begin receiving the reply.
System::EventLoop * loop() const
Returns the used event loop.
void setActive(System::EventLoop &loop)
Sets the event loop to use.
Client(System::EventLoop &loop)
Construct with event loop.
MessageProgress endReceive()
End receiving the reply.
Client()
Default Constructor.
Signal< Client & > & replyReceived()
Signals that a part of the reply was received.
void send(bool finished=true)
Blocks until request is sent.
std::istream & receive()
Blocks until reply is received.
MessageProgress endSend()
End sending the request.
Client(System::EventLoop &loop, const Net::Endpoint &ep)
Construct with loop and host to connect to.
void setHost(const Net::Endpoint &ep, const Net::TcpSocketOptions &opts)
Sets the host to connect to.
void setPeerName(const std::string &peer)
Sets the expected SSL peer name.
Progress of an asynchronous HTTP send or receive.
Definition Message.h:337
HTTP reply message.
Definition Reply.h:64
HTTP request message.
Definition Request.h:65
Host and service address.
Definition Endpoint.h:77
TCP socket connection options.
Definition TcpSocket.h:51
NonCopyable()
Default constructor.
Definition NonCopyable.h:63
Multicast Signal to call multiple slots.
Definition Signal.h:190
Shared configuration for SSL connections.
Definition Context.h:113
Event loop of a thread or process.
Definition EventLoop.h:83
HTTP clients and servers.
TCP and UDP network sockets.
Definition Client.h:45
SSL/TLS streams, certificates and contexts.
Definition Client.h:50
System programming
Definition Connection.h:26
Core module.
Definition Allocator.h:33