C++ Rest SDK
The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Public Member Functions | List of all members
web::http::client::http_client_config Class Reference

HTTP client configuration class, used to set the possible configuration options used to create an http_client instance. More...

#include <http_client.h>

Public Member Functions

const std::shared_ptr< oauth1::experimental::oauth1_configoauth1 () const
 Get OAuth 1.0 configuration. More...
 
void set_oauth1 (oauth1::experimental::oauth1_config config)
 Set OAuth 1.0 configuration. More...
 
const std::shared_ptr< oauth2::experimental::oauth2_configoauth2 () const
 Get OAuth 2.0 configuration. More...
 
void set_oauth2 (oauth2::experimental::oauth2_config config)
 Set OAuth 2.0 configuration. More...
 
const web_proxyproxy () const
 Get the web proxy object More...
 
void set_proxy (web_proxy proxy)
 Set the web proxy object More...
 
const http::client::credentialscredentials () const
 Get the client credentials More...
 
void set_credentials (const http::client::credentials &cred)
 Set the client credentials More...
 
bool guarantee_order () const
 Get the 'guarantee order' property More...
 
void set_guarantee_order (bool guarantee_order)
 Set the 'guarantee order' property More...
 
utility::seconds timeout () const
 Get the timeout More...
 
template<class T >
timeout () const
 Get the timeout More...
 
template<class T >
void set_timeout (const T &timeout)
 Set the timeout More...
 
size_t chunksize () const
 Get the client chunk size. More...
 
void set_chunksize (size_t size)
 Sets the client chunk size. More...
 
bool is_default_chunksize () const
 Returns true if the default chunk size is in use. More...
 
bool validate_certificates () const
 Gets the server certificate validation property. More...
 
void set_validate_certificates (bool validate_certs)
 Sets the server certificate validation property. More...
 
void set_nativehandle_options (const std::function< void(native_handle)> &callback)
 Sets a callback to enable custom setting of platform specific options. More...
 
void invoke_nativehandle_options (native_handle handle) const
 Invokes a user's callback to allow for customization of the request. More...
 
void set_ssl_context_callback (const std::function< void(boost::asio::ssl::context &)> &callback)
 Sets a callback to enable custom setting of the ssl context, at construction time. More...
 
const std::function< void(boost::asio::ssl::context &)> & get_ssl_context_callback () const
 Gets the user's callback to allow for customization of the ssl context. More...
 

Detailed Description

HTTP client configuration class, used to set the possible configuration options used to create an http_client instance.

Member Function Documentation

size_t web::http::client::http_client_config::chunksize ( ) const
inline

Get the client chunk size.

Returns
The internal buffer size used by the http client when sending and receiving data from the network.
const http::client::credentials& web::http::client::http_client_config::credentials ( ) const
inline

Get the client credentials

Returns
A reference to the client credentials.
const std::function<void(boost::asio::ssl::context&)>& web::http::client::http_client_config::get_ssl_context_callback ( ) const
inline

Gets the user's callback to allow for customization of the ssl context.

bool web::http::client::http_client_config::guarantee_order ( ) const
inline

Get the 'guarantee order' property

Returns
The value of the property.
void web::http::client::http_client_config::invoke_nativehandle_options ( native_handle  handle) const
inline

Invokes a user's callback to allow for customization of the request.

Parameters
handleA internal implementation handle.
bool web::http::client::http_client_config::is_default_chunksize ( ) const
inline

Returns true if the default chunk size is in use.

If true, implementations are allowed to choose whatever size is best.

Returns
True if default, false if set by user.
const std::shared_ptr<oauth1::experimental::oauth1_config> web::http::client::http_client_config::oauth1 ( ) const
inline

Get OAuth 1.0 configuration.

Returns
Shared pointer to OAuth 1.0 configuration.
const std::shared_ptr<oauth2::experimental::oauth2_config> web::http::client::http_client_config::oauth2 ( ) const
inline

Get OAuth 2.0 configuration.

Returns
Shared pointer to OAuth 2.0 configuration.
const web_proxy& web::http::client::http_client_config::proxy ( ) const
inline

Get the web proxy object

Returns
A reference to the web proxy object.
void web::http::client::http_client_config::set_chunksize ( size_t  size)
inline

Sets the client chunk size.

Parameters
sizeThe internal buffer size used by the http client when sending and receiving data from the network.

This is a hint – an implementation may disregard the setting and use some other chunk size.

void web::http::client::http_client_config::set_credentials ( const http::client::credentials cred)
inline

Set the client credentials

Parameters
credA reference to the client credentials.
void web::http::client::http_client_config::set_guarantee_order ( bool  guarantee_order)
inline

Set the 'guarantee order' property

Parameters
guarantee_orderThe value of the property.
void web::http::client::http_client_config::set_nativehandle_options ( const std::function< void(native_handle)> &  callback)
inline

Sets a callback to enable custom setting of platform specific options.

The native_handle is the following type depending on the underlying platform: Windows Desktop, WinHTTP - HINTERNET Windows Runtime, WinRT - IXMLHTTPRequest2 * All other platforms, Boost.Asio: https - boost::asio::ssl::stream<boost::asio::ip::tcp::socket &> * http - boost::asio::ip::tcp::socket *

Parameters
callbackA user callback allowing for customization of the request
void web::http::client::http_client_config::set_oauth1 ( oauth1::experimental::oauth1_config  config)
inline

Set OAuth 1.0 configuration.

Parameters
configOAuth 1.0 configuration to set.
void web::http::client::http_client_config::set_oauth2 ( oauth2::experimental::oauth2_config  config)
inline

Set OAuth 2.0 configuration.

Parameters
configOAuth 2.0 configuration to set.
void web::http::client::http_client_config::set_proxy ( web_proxy  proxy)
inline

Set the web proxy object

Parameters
proxyA reference to the web proxy object.
void web::http::client::http_client_config::set_ssl_context_callback ( const std::function< void(boost::asio::ssl::context &)> &  callback)
inline

Sets a callback to enable custom setting of the ssl context, at construction time.

Parameters
callbackA user callback allowing for customization of the ssl context at construction time.
template<class T >
void web::http::client::http_client_config::set_timeout ( const T &  timeout)
inline

Set the timeout

Parameters
timeoutThe timeout (duration from microseconds range and up) used for each send and receive operation on the client.
void web::http::client::http_client_config::set_validate_certificates ( bool  validate_certs)
inline

Sets the server certificate validation property.

Parameters
validate_certsFalse to turn ignore all server certificate validation errors, true otherwise.

Note ignoring certificate errors can be dangerous and should be done with caution.

utility::seconds web::http::client::http_client_config::timeout ( ) const
inline

Get the timeout

Returns
The timeout (in seconds) used for each send and receive operation on the client.
template<class T >
T web::http::client::http_client_config::timeout ( ) const
inline

Get the timeout

Returns
The timeout (in whatever duration) used for each send and receive operation on the client.
bool web::http::client::http_client_config::validate_certificates ( ) const
inline

Gets the server certificate validation property.

Returns
True if certificates are to be verified, false otherwise.

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