Table of Contents

Interface IRequest

Namespace
Amazon.Runtime.Internal
Assembly
AWSSDK.Core.dll

Represents a request being sent to an Amazon Web Service, including the parameters being sent as part of the request, the endpoint to which the request should be sent, etc.

This class is only intended for internal use inside the AWS client libraries. Callers shouldn't ever interact directly with objects of this class.

public interface IRequest
Extension Methods

Properties

AWS4SignerResult

If using AWS4 signing protocol, contains the resultant parts of the signature that we may need to make use of if we elect to do a chunked encoding upload.

AWS4SigningResult AWS4SignerResult { get; set; }

Property Value

AWS4SigningResult

AlternateEndpoint

Alternate endpoint to use for this request, if any.

RegionEndpoint AlternateEndpoint { get; set; }

Property Value

RegionEndpoint

AuthenticationRegion

The authentication region to use for the request. Set from Config.AuthenticationRegion.

string AuthenticationRegion { get; set; }

Property Value

string

CanonicalResourcePrefix

Used for Amazon S3 requests where the bucket name is removed from the marshalled resource path into the host header. To comply with AWS2 signature calculation, we need to recover the bucket name and include it in the resource canonicalization, which we do using this field.

string CanonicalResourcePrefix { get; set; }

Property Value

string

Content

Gets and Sets the content for this request.

byte[] Content { get; set; }

Property Value

byte[]

ContentStream

Gets and sets the content stream.

Stream ContentStream { get; set; }

Property Value

Stream

DeterminedSigningRegion

The region in which the service request was signed.

string DeterminedSigningRegion { get; set; }

Property Value

string

Endpoint

Gets and Sets the endpoint for this request.

Uri Endpoint { get; set; }

Property Value

Uri

Headers

Returns a dictionary of the headers included in this request.

IDictionary<string, string> Headers { get; }

Property Value

IDictionary<string, string>

HostPrefix

Host prefix value to prepend to the endpoint for this request, if any.

string HostPrefix { get; set; }

Property Value

string

HttpMethod

Gets and sets the type of http request to make, whether it should be POST,GET or DELETE

string HttpMethod { get; set; }

Property Value

string

MarshallerVersion

Gets and Sets the version number for the marshaller used to create this request. The version number is used to support backward compatible changes that would otherwise be breaking changes when a newer core is used with an older service assembly.

int MarshallerVersion { get; set; }

Property Value

int

OriginalRequest

Returns the original, user facing request object which this internal request object is representing.

AmazonWebServiceRequest OriginalRequest { get; }

Property Value

AmazonWebServiceRequest

OriginalStreamPosition

Gets and sets the original stream position. If ContentStream is null or does not support seek, this propery should be equal to -1.

long OriginalStreamPosition { get; set; }

Property Value

long

ParameterCollection

Collection of parameters included in this request.

ParameterCollection ParameterCollection { get; }

Property Value

ParameterCollection

Parameters

Returns a dictionary of the parameters included in this request.

IDictionary<string, string> Parameters { get; }

Property Value

IDictionary<string, string>

PathResources

Returns the path resources that should be used within the resource path. This is used for services where path keys can contain '/' characters, making string-splitting of a resource path potentially hazardous.

IDictionary<string, string> PathResources { get; }

Property Value

IDictionary<string, string>

RequestName

The name of the request

string RequestName { get; }

Property Value

string

ResourcePath

Gets and Sets the resource path added on to the endpoint.

string ResourcePath { get; set; }

Property Value

string

ServiceName

The name of the service to which this request is being sent.

string ServiceName { get; }

Property Value

string

SetContentFromParameters

Flag that signals that Content was and should be set from the Parameters collection.

bool SetContentFromParameters { get; set; }

Property Value

bool

SubResources

Returns the subresources that should be appended to the resource path. This is used primarily for Amazon S3, where object keys can contain '?' characters, making string-splitting of a resource path potentially hazardous.

IDictionary<string, string> SubResources { get; }

Property Value

IDictionary<string, string>

Suppress404Exceptions

Gets and sets the Suppress404Exceptions property. If true then 404s return back from AWS will not cause an exception and an empty response object will be returned.

bool Suppress404Exceptions { get; set; }

Property Value

bool

UseChunkEncoding

Determine whether to use a chunked encoding upload for the request (applies to Amazon S3 PutObject and UploadPart requests only).

bool UseChunkEncoding { get; set; }

Property Value

bool

UseQueryString

Gets and sets a flag that indicates whether the request is sent as a query string instead of the request body.

bool UseQueryString { get; set; }

Property Value

bool

UseSigV4

This flag specifies if SigV4 is required for the current request.

bool UseSigV4 { get; set; }

Property Value

bool

Methods

AddPathResource(string, string)

Adds a new entry to the PathResources collection for the request

void AddPathResource(string key, string value)

Parameters

key string

The name of the pathresource with potential greedy syntax: {key+}

value string

Value of the entry

AddSubResource(string)

Adds a new null entry to the SubResources collection for the request

void AddSubResource(string subResource)

Parameters

subResource string

The name of the subresource

AddSubResource(string, string)

Adds a new entry to the SubResources collection for the request

void AddSubResource(string subResource, string value)

Parameters

subResource string

The name of the subresource

value string

Value of the entry

ComputeContentStreamHash()

Computes the SHA 256 hash of the content stream. If the stream is not seekable, it searches the parent stream hierarchy to find a seekable stream prior to computation. Once computed, the hash is cached for future use.

string ComputeContentStreamHash()

Returns

string

GetHeaderValue(string)

Gets the header value from the request.

string GetHeaderValue(string headerName)

Parameters

headerName string

Returns

string

HasRequestBody()

Returns true if the request has a body, else false.

bool HasRequestBody()

Returns

bool

Returns true if the request has a body, else false.

IsRequestStreamRewindable()

Checks if the request stream can be rewinded.

bool IsRequestStreamRewindable()

Returns

bool

Returns true if the request stream can be rewinded , else false.

MayContainRequestBody()

Returns true if the request can contain a request body, else false.

bool MayContainRequestBody()

Returns

bool

Returns true if the currect request can contain a request body, else false.