azure-core
Loading...
Searching...
No Matches
transport.hpp
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
9#pragma once
10
12#include "azure/core/dll_import_export.hpp"
15
16#include <memory>
17
18namespace Azure { namespace Core { namespace Http {
19
20 namespace _internal {
26 AZ_CORE_DLLEXPORT extern const Context::Key HttpConnectionTimeout;
27 } // namespace _internal
28
33 public:
34 // If we get a response that goes up the stack
35 // Any errors in the pipeline throws an exception
36 // At the top of the pipeline we might want to turn certain responses into exceptions
37
44 // TODO - Should this be const
45 virtual std::unique_ptr<RawResponse> Send(Request& request, Context const& context) = 0;
46
51 virtual ~HttpTransport() {}
52
53 protected:
58 HttpTransport() = default;
59
65 HttpTransport(const HttpTransport& other) = default;
66
72 HttpTransport(HttpTransport&& other) = default;
73
81 HttpTransport& operator=(const HttpTransport& other) = default;
82
87 virtual bool HasWebSocketSupport() const { return false; }
88 };
89
90}}} // namespace Azure::Core::Http
A context is a node within a unidirectional tree that represents deadlines and key/value pairs.
Definition context.hpp:72
Base class for all HTTP transport implementations.
Definition transport.hpp:32
HttpTransport(HttpTransport &&other)=default
Constructs HttpTransport by moving another instance of HttpTransport.
HttpTransport & operator=(const HttpTransport &other)=default
Assigns HttpTransport to another instance of HttpTransport.
virtual ~HttpTransport()
Destructs HttpTransport.
Definition transport.hpp:51
HttpTransport()=default
Constructs a default instance of HttpTransport.
virtual bool HasWebSocketSupport() const
Returns true if the HttpTransport supports WebSockets (the ability to communicate bidirectionally on ...
Definition transport.hpp:87
virtual std::unique_ptr< RawResponse > Send(Request &request, Context const &context)=0
Send an HTTP request over the wire.
HttpTransport(const HttpTransport &other)=default
Constructs HttpTransport by copying another instance of HttpTransport.
A request message from a client to a server.
Definition http.hpp:183
Context for canceling long running operations.
HTTP request and response functionality.
Compute the hash value for the input binary data, using SHA256, SHA384 and SHA512.
Definition azure_assert.hpp:57
Define the HTTP raw response.