Table of Contents

Interface IHttpRequest<TRequestContent>

Namespace
Amazon.Runtime
Assembly
AWSSDK.Core.dll

The interface for an HTTP request that is agnostic of the underlying HTTP API.

public interface IHttpRequest<TRequestContent> : IDisposable

Type Parameters

TRequestContent

The type used by the underlying HTTP API to represent the HTTP request content.

Inherited Members

Properties

Method

The HTTP method or verb.

string Method { get; set; }

Property Value

string

RequestUri

The request URI.

Uri RequestUri { get; }

Property Value

Uri

Methods

Abort()

Aborts the HTTP request.

void Abort()

ConfigureRequest(IRequestContext)

Configures a request as per the request context.

void ConfigureRequest(IRequestContext requestContext)

Parameters

requestContext IRequestContext

The request context.

GetRequestContent()

Gets a handle to the request content.

TRequestContent GetRequestContent()

Returns

TRequestContent

The request content.

GetRequestContentAsync()

Gets a handle to the request content.

Task<TRequestContent> GetRequestContentAsync()

Returns

Task<TRequestContent>

GetResponse()

Returns the HTTP response.

IWebResponseData GetResponse()

Returns

IWebResponseData

The HTTP response.

GetResponseAsync(CancellationToken)

Returns the HTTP response.

Task<IWebResponseData> GetResponseAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

A cancellation token that can be used to cancel the asynchronous operation.

Returns

Task<IWebResponseData>

SetRequestHeaders(IDictionary<string, string>)

Sets the headers on the request.

void SetRequestHeaders(IDictionary<string, string> headers)

Parameters

headers IDictionary<string, string>

A dictionary of header names and values.

SetupProgressListeners(Stream, long, object, EventHandler<StreamTransferProgressArgs>)

Sets up the progress listeners

Stream SetupProgressListeners(Stream originalStream, long progressUpdateInterval, object sender, EventHandler<StreamTransferProgressArgs> callback)

Parameters

originalStream Stream

The content stream

progressUpdateInterval long

The interval at which progress needs to be published

sender object

The objects which is trigerring the progress changes

callback EventHandler<StreamTransferProgressArgs>

The callback which will be invoked when the progress changed event is trigerred

Returns

Stream

an EventStream object, incase the progress is setup, else returns the original stream

WriteToRequestBody(TRequestContent, byte[], IDictionary<string, string>)

Writes a byte array to the request body.

void WriteToRequestBody(TRequestContent requestContent, byte[] content, IDictionary<string, string> contentHeaders)

Parameters

requestContent TRequestContent

The destination where the content stream is written.

content byte[]

The content stream to be written.

contentHeaders IDictionary<string, string>

HTTP content headers.

WriteToRequestBody(TRequestContent, Stream, IDictionary<string, string>, IRequestContext)

Writes a stream to the request body.

void WriteToRequestBody(TRequestContent requestContent, Stream contentStream, IDictionary<string, string> contentHeaders, IRequestContext requestContext)

Parameters

requestContent TRequestContent

The destination where the content stream is written.

contentStream Stream

The content stream to be written.

contentHeaders IDictionary<string, string>

HTTP content headers.

requestContext IRequestContext

The request context.