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()

BeginGetRequestContent(AsyncCallback, object)

Initiates the operation to gets a handle to the request content.

IAsyncResult BeginGetRequestContent(AsyncCallback callback, object state)

Parameters

callback AsyncCallback

The async callback invoked when the operation completes.

state object

The state object to be passed to the async callback.

Returns

IAsyncResult

IAsyncResult that represents an async operation.

BeginGetResponse(AsyncCallback, object)

Initiates the operation to Returns the HTTP response.

IAsyncResult BeginGetResponse(AsyncCallback callback, object state)

Parameters

callback AsyncCallback

The async callback invoked when the operation completes.

state object

The state object to be passed to the async callback.

Returns

IAsyncResult

IAsyncResult that represents an async operation.

ConfigureRequest(IRequestContext)

Configures a request as per the request context.

void ConfigureRequest(IRequestContext requestContext)

Parameters

requestContext IRequestContext

The request context.

EndGetRequestContent(IAsyncResult)

Ends the operation to gets a handle to the request content.

TRequestContent EndGetRequestContent(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

IAsyncResult that represents an async operation.

Returns

TRequestContent

The request content.

EndGetResponse(IAsyncResult)

Ends the operation to Returns the HTTP response.

IWebResponseData EndGetResponse(IAsyncResult asyncResult)

Parameters

asyncResult IAsyncResult

IAsyncResult that represents an async operation.

Returns

IWebResponseData

The HTTP response.

GetRequestContent()

Gets a handle to the request content.

TRequestContent GetRequestContent()

Returns

TRequestContent

The request content.

GetResponse()

Returns the HTTP response.

IWebResponseData GetResponse()

Returns

IWebResponseData

The HTTP response.

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.