C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::net::http::client_factory Class Reference

Factory for the with(...).connect(...).request(...) DSL. More...

#include <client_factory.hpp>

Inheritance diagram for caf::net::http::client_factory:
caf::net::dsl::client_factory_base< client_factory >

Public Member Functions

template<class Token , class... Args>
 client_factory (Token token, const dsl::generic_config_value &from, Args &&... args)
 
 client_factory (client_factory &&other) noexcept
 
client_factoryoperator= (client_factory &&other) noexcept
 
client_factoryadd_header_field (std::string key, std::string value)
 Add an additional HTTP header field to the request.
 
expected< std::pair< async::future< response >, disposable > > get ()
 Sends an HTTP GET message.
 
expected< std::pair< async::future< response >, disposable > > head ()
 Sends an HTTP HEAD message.
 
expected< std::pair< async::future< response >, disposable > > post (std::string_view payload)
 Sends an HTTP POST message.
 
expected< std::pair< async::future< response >, disposable > > put (std::string_view payload)
 Sends an HTTP PUT message.
 
expected< std::pair< async::future< response >, disposable > > del ()
 Sends an HTTP DELETE message.
 
expected< std::pair< async::future< response >, disposable > > connect ()
 Sends an HTTP CONNECT message.
 
expected< std::pair< async::future< response >, disposable > > options (std::string_view payload)
 Sends an HTTP OPTIONS message.
 
expected< std::pair< async::future< response >, disposable > > trace (std::string_view payload)
 Sends an HTTP TRACE message.
 
expected< std::pair< async::future< response >, disposable > > request (http::method method, std::string_view payload=std::string_view{})
 Utility function to make a request with given parameters.
 
expected< std::pair< async::future< response >, disposable > > request (http::method method, const_byte_span payload)
 Utility function to make a request with given parameters.
 
template<typename Conn >
expected< std::pair< async::future< response >, disposable > > do_start_impl (Conn conn, http::method method, const_byte_span payload)
 
- Public Member Functions inherited from caf::net::dsl::client_factory_base< client_factory >
client_factory & do_on_error (F callback)
 Sets the callback for errors.
 
client_factory & retry_delay (timespan value)
 Sets the retry delay for connection attempts.
 
client_factory & connection_timeout (timespan value)
 Sets the connection timeout for connection attempts.
 
client_factory & max_retry_count (size_t value)
 Sets the maximum number of connection retry attempts.
 

Protected Member Functions

dsl::client_config_value & base_config () override
 
- Protected Member Functions inherited from caf::net::dsl::client_factory_base< client_factory >
client_factory & dref ()
 
auto with_ssl_connection (Fn &&fn)
 
auto with_ssl_connection_or_socket (Fn &&fn)
 
auto with_ssl_connection_or_socket_select (bool use_ssl, Fn &&fn)
 

Detailed Description

Factory for the with(...).connect(...).request(...) DSL.

Member Function Documentation

◆ base_config()

dsl::client_config_value & caf::net::http::client_factory::base_config ( )
overrideprotectedvirtual

The documentation for this class was generated from the following files: