19#ifndef CPPREALM_NETWORKING_HTTP_HPP
20#define CPPREALM_NETWORKING_HTTP_HPP
22#include <cpprealm/internal/bridge/realm.hpp>
24#ifndef REALMCXX_VERSION_MAJOR
25#include <cpprealm/version_numbers.hpp>
32namespace realm::networking {
37 enum class http_method { get, post, patch, put, del };
41 using http_headers = std::map<std::string, std::string>;
50 http_method
method = http_method::get;
109 std::function<
void(
const response&)>&& completion) = 0;
113 std::shared_ptr<http_transport_client> make_http_client();
115 [[maybe_unused]]
void set_http_client_factory(std::function<std::shared_ptr<http_transport_client>()>&&);
127 std::optional<::realm::internal::bridge::realm::sync_config::proxy_config>
proxy_config;
129 using SSLVerifyCallback = bool(
const std::string& server_address,
130 internal::bridge::realm::sync_config::proxy_config::port_type server_port,
131 const char* pem_data,
size_t pem_size,
int preverify_ok,
int depth);
153 void send_request_to_server(const ::realm::networking::request&
request,
154 std::function<
void(const ::realm::networking::response&)>&& completion);
157 configuration m_configuration;
std::optional<::realm::internal::bridge::realm::sync_config::proxy_config > proxy_config
Definition: http.hpp:127
std::optional< std::string > ssl_trust_certificate_path
Definition: http.hpp:139
std::function< SSLVerifyCallback > ssl_verify_callback
Definition: http.hpp:145
bool client_validate_ssl
Definition: http.hpp:135
std::optional< std::map< std::string, std::string > > custom_http_headers
Definition: http.hpp:123
Built in HTTP transport client.
Definition: http.hpp:118
http_headers headers
Definition: http.hpp:66
std::string body
Definition: http.hpp:71
uint64_t timeout_ms
Definition: http.hpp:61
http_method method
Definition: http.hpp:50
std::string url
Definition: http.hpp:55
std::string body
Definition: http.hpp:96
http_headers headers
Definition: http.hpp:91
std::optional< std::int32_t > client_error_code
Definition: http.hpp:101
int custom_status_code
Definition: http.hpp:86
int http_status_code
Definition: http.hpp:81