AWS IoT Device SDK C++ v2: Aws::Crt::Http Namespace Reference

AWS IoT Device SDK C++ v2 1.14.0 AWS IoT Device SDK C++ v2

Classes | Typedefs | Enumerations
Aws::Crt::Http Namespace Reference

## Classes
class | AdaptiveHttpProxyStrategy
struct | ClientStreamCallbackData
struct | ConnectionCallbackData
struct | ConnectionManagerCallbackArgs
class | HttpClientConnection
class | HttpClientConnectionManager
class | HttpClientConnectionManagerOptions
class | HttpClientConnectionOptions
class | HttpClientConnectionProxyOptions
class | HttpClientStream
class | HttpMessage
class | HttpProxyStrategy
struct | HttpProxyStrategyAdaptiveConfig
struct | HttpProxyStrategyBasicAuthConfig
class | HttpRequest
struct | HttpRequestOptions
class | HttpResponse
class | HttpStream
class | ManagedConnection
class | UnmanagedConnection

## Typedefs
using | HttpHeader = aws_http_header
using | OnConnectionSetup = std::function< void(const std::shared_ptr< HttpClientConnection > &connection, int errorCode)>
using | OnConnectionShutdown = std::function< void(HttpClientConnection &connection, int errorCode)>
using | OnIncomingHeaders = std::function< void(HttpStream &stream, enum aws_http_header_block headerBlock, const HttpHeader *headersArray, std::size_t headersCount)>
using | OnIncomingHeadersBlockDone = std::function< void(HttpStream &stream, enum aws_http_header_block block)>
using | OnIncomingBody = std::function< void(HttpStream &stream, const ByteCursor &data)>
using | OnStreamComplete = std::function< void(HttpStream &stream, int errorCode)>
using | OnClientConnectionAvailable = std::function< void(std::shared_ptr< HttpClientConnection >, int errorCode)>
using | KerberosGetTokenFunction = std::function< bool(String &)>
using | NtlmGetTokenFunction = std::function< bool(const String &, String &)>

## Enumerations
enum class | AwsHttpProxyAuthenticationType { None , Basic }
enum class | AwsHttpProxyConnectionType { Legacy = AWS_HPCT_HTTP_LEGACY , Forwarding = AWS_HPCT_HTTP_FORWARD , Tunneling = AWS_HPCT_HTTP_TUNNEL }
enum class | HttpVersion { Unknown = AWS_HTTP_VERSION_UNKNOWN , Http1_0 = AWS_HTTP_VERSION_1_0 , Http1_1 = AWS_HTTP_VERSION_1_1 , Http2 = AWS_HTTP_VERSION_2 }

## Typedef Documentation

## ◆ HttpHeader

typedef aws_http_header Aws::Crt::Http::HttpHeader

## ◆ KerberosGetTokenFunction

using Aws::Crt::Http::KerberosGetTokenFunction = typedef std::function<bool(String &)>

## ◆ NtlmGetTokenFunction

using Aws::Crt::Http::NtlmGetTokenFunction = typedef std::function<bool(const String &, String &)>

## ◆ OnClientConnectionAvailable

using Aws::Crt::Http::OnClientConnectionAvailable = typedef std::function<void(std::shared_ptr<HttpClientConnection>, int errorCode)>

Invoked when a connection from the pool is available. If a connection was successfully obtained the connection shared_ptr can be seated into your own copy of connection. If it failed, errorCode will be non-zero.

## ◆ OnConnectionSetup

using Aws::Crt::Http::OnConnectionSetup = typedef std::function<void(const std::shared_ptr<HttpClientConnection> &connection, int errorCode)>

Invoked upon connection setup, whether it was successful or not. If the connection was successfully established, `connection` will be valid and errorCode will be AWS_ERROR_SUCCESS. Upon an error, `connection` will not be valid, and errorCode will contain the cause of the connection failure.

## ◆ OnConnectionShutdown

using Aws::Crt::Http::OnConnectionShutdown = typedef std::function<void(HttpClientConnection &connection, int errorCode)>

Invoked upon connection shutdown. `connection` will always be a valid pointer. `errorCode` will specify shutdown reason. A graceful connection close will set `errorCode` to AWS_ERROR_SUCCESS. Internally, the connection pointer will be unreferenced immediately after this call; if you took a reference to it in OnConnectionSetup(), you'll need to release your reference before the underlying memory is released. If you never took a reference to it, the resources for the connection will be immediately released after completion of this callback.

## ◆ OnIncomingBody

using Aws::Crt::Http::OnIncomingBody = typedef std::function<void(HttpStream &stream, const ByteCursor &data)>

Invoked as chunks of the body are read. `data` contains the data read from the wire. If chunked encoding was used, it will already be decoded (TBD).

On HttpStream, this function can be empty if you are not expecting a body (e.g. a HEAD request).

## ◆ OnIncomingHeaders

using Aws::Crt::Http::OnIncomingHeaders = typedef std::function<void( HttpStream &stream, enum aws_http_header_block headerBlock, const HttpHeader *headersArray, std::size_t headersCount)>

Called as headers are received from the peer. `headersArray` will contain the header value read from the wire. The number of entries in `headersArray` are specified in `headersCount`.

Keep in mind that this function will likely be called multiple times until all headers are received.

On HttpStream, this function must be set.

## ◆ OnIncomingHeadersBlockDone

using Aws::Crt::Http::OnIncomingHeadersBlockDone = typedef std::function<void(HttpStream &stream, enum aws_http_header_block block)>

Invoked when the headers portion of the message has been completely received. `hasBody` will indicate if there is an incoming body.

On HttpStream, this function can be empty.

## ◆ OnStreamComplete

using Aws::Crt::Http::OnStreamComplete = typedef std::function<void(HttpStream &stream, int errorCode)>

Invoked upon completion of the stream. This means the request has been sent and a completed response has been received (in client mode), or the request has been received and the response has been completed.

In H2, this will mean RST_STREAM state has been reached for the stream.

On HttpStream, this function must be set.

## Enumeration Type Documentation

## ◆ AwsHttpProxyAuthenticationType

enum class Aws::Crt::Http::AwsHttpProxyAuthenticationType
| strong

Deprecated:
  enum that designates what kind of authentication, if any, to use when connecting to a proxy server.

Here for backwards compatibility. Has been superceded by proxy strategies.

Enumerator
None |
Basic |

## ◆ AwsHttpProxyConnectionType

enum class Aws::Crt::Http::AwsHttpProxyConnectionType
| strong

Mirror of aws_http_proxy_connection_type enum. Indicates the basic http proxy behavior of the proxy we're connecting to.

Enumerator
Legacy | Deprecated, but 0-valued for backwards compatibility If tls options are provided (for the main connection) then treat the proxy as a tunneling proxy If tls options are not provided (for the main connection), then treat the proxy as a forwarding proxy
Forwarding | Use the proxy to forward http requests. Attempting to use both this mode and TLS to the destination is a configuration error.
Tunneling | Use the proxy to establish an http connection via a CONNECT request to the proxy. Works for both plaintext and tls connections.

## ◆ HttpVersion

enum class Aws::Crt::Http::HttpVersion
| strong

Enumerator
Unknown |
Http1_0 |
Http1_1 |
Http2 |