15 #include "azure/core/internal/unique_handle.hpp"
18 #if defined(AZ_PLATFORM_WINDOWS)
19 #if !defined(WIN32_LEAN_AND_MEAN)
20 #define WIN32_LEAN_AND_MEAN
22 #if !defined(NOMINMAX)
29 #include <type_traits>
34 namespace Azure {
namespace Core {
43 template <>
struct UniqueHandleHelper<HINTERNET>
45 static void FreeHandle(HINTERNET obj) { WinHttpCloseHandle(obj); }
47 using type = BasicUniqueHandle<void, FreeHandle>;
55 constexpr
static size_t DefaultUploadChunkSize = 1024 * 64;
56 constexpr
static size_t MaximumUploadChunkSize = 1024 * 1024;
130 const Azure::Core::_internal::UniqueHandle<HINTERNET> m_sessionHandle;
132 Azure::Core::_internal::UniqueHandle<HINTERNET> CreateSessionHandle();
133 Azure::Core::_internal::UniqueHandle<HINTERNET> CreateConnectionHandle(
136 std::unique_ptr<_detail::WinHttpRequest> CreateRequestHandle(
137 Azure::Core::_internal::UniqueHandle<HINTERNET>
const& connectionHandle,
143 virtual void OnUpgradedConnection(std::unique_ptr<_detail::WinHttpRequest>
const&){};
151 void GetErrorAndThrow(
const std::string& exceptionMessage, DWORD error = GetLastError());
181 virtual std::unique_ptr<RawResponse>
Send(
Request& request,
Context const& context)
override;
A context is a node within a tree that represents deadlines and key/value pairs.
Definition: context.hpp:45
The method to be performed on the resource identified by the Request.
Definition: http.hpp:94
Base class for all HTTP transport implementations.
Definition: transport.hpp:19
A request message from a client to a server.
Definition: http.hpp:176
Concrete implementation of an HTTP transport that uses WinHTTP when sending and receiving requests an...
Definition: win_http_transport.hpp:126
virtual std::unique_ptr< RawResponse > Send(Request &request, Context const &context) override
Implements the HTTP transport interface to send an HTTP Request and produce an HTTP RawResponse.
Definition: win_http_transport.cpp:1301
WinHttpTransport(WinHttpTransportOptions const &options=WinHttpTransportOptions())
Constructs WinHttpTransport.
Definition: win_http_transport.cpp:772
Represents the location where a request will be performed.
Definition: url.hpp:46
Context for canceling long running operations.
HTTP request and response functionality.
Azure SDK abstractions.
Definition: azure_assert.hpp:55
HTTP transport policies, and their options.
HTTP transport options parameterize the HTTP transport adapter being used.
Definition: policy.hpp:138
Sets the WinHTTP session and connection options used to customize the behavior of the transport.
Definition: win_http_transport.hpp:67
bool EnableCertificateRevocationListCheck
If True, enables checks for certificate revocation.
Definition: win_http_transport.hpp:91
std::vector< std::string > ExpectedTlsRootCertificates
Array of Base64 encoded DER encoded X.509 certificate. These certificates should form a chain of cert...
Definition: win_http_transport.hpp:119
bool IgnoreUnknownCertificateAuthority
When true, allows an invalid certificate authority.
Definition: win_http_transport.hpp:71
bool EnableSystemDefaultProxy
If True, enables the use of the system default proxy.
Definition: win_http_transport.hpp:86
Azure::Nullable< std::string > ProxyUserName
User name for proxy authentication.
Definition: win_http_transport.hpp:107
std::string ProxyInformation
Proxy information.
Definition: win_http_transport.hpp:102
Azure::Nullable< std::string > ProxyPassword
Password for proxy authentication.
Definition: win_http_transport.hpp:112
Utilities to be used by HTTP transport implementations.