AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

AwsHttpClient is a wrapper around HttpClient class of the System.Net.Http library. The wrapper has been added so as to remove System.Net.Http dependencies from the Services and migrate it to a Core level dependecy only. This avoids version clashes when a service and the Core depends on different versions of the System.Net.Http library. This is a Service level utility method

Inheritance Hierarchy

System.Object
  Amazon.Util.AWSHttpClient

Namespace: Amazon.Util
Assembly: AWSSDK.Core.dll
Version: 3.x.y.z

Syntax

C#
public class AWSHttpClient
         IDisposable

The AWSHttpClient type exposes the following members

Constructors

NameDescription
Public Method AWSHttpClient()

AWSHttpClient wrapper that is wrapped around HttpClient default wrapper.

Properties

NameTypeDescription
Public Property BaseAddress System.Uri

AWSHttpClient BaseAddress property that is wrapper for HttpClient BaseAddress property.

Public Property MaxResponseContentBufferSize System.Int64

AWSHttpClient MaxResponseContentBufferSize property that is wrapper for HttpClient MaxResponseContentBufferSize property.

Public Property Timeout System.TimeSpan

AWSHttpClient Timeout property that is wrapper for HttpClient Timeout property.

Methods

Note:

Asynchronous operations (methods ending with Async) in the table below are for .NET 4.5 or higher. For .NET 3.5 the SDK follows the standard naming convention of BeginMethodName and EndMethodName to indicate asynchronous operations - these method pairs are not shown in the table below.

NameDescription
Public Method Dispose()

Wrapper for HttpClient Dispose.

Public Method GetResponseHeadersAsync(string, string)

Wrapper for HttpClient's HttpRequestMessage and SendAsync methods.

Public Method GetStreamAsync(string)

AWSHttpClient GetStreamAsync that accepts the requester's URI and make a HttpClient.GetStreamAsync call.

Public Method Static Method IsHttpInnerException(Exception)

Method that checks if the passed exception is of type HttpRequestException

Public Method PutRequestUriAsync(string, AWSStreamContent, IDictionary<String, String>)

Wrapper method that accepts a request uri, stream content and headers and makes a sendAsync call.

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5