Class Response
Represents the HTTP response from the service.
Inheritance
Namespace: System.Dynamic.ExpandoObject
Assembly: Azure.Core.dll
Syntax
public abstract class Response : IDisposable
Constructors
Response()
Declaration
protected Response ();
Properties
ClientRequestId
Gets the client request id that was sent to the server as x-ms-client-request-id
headers.
Declaration
public abstract string ClientRequestId { get; set; }
Property Value
System.String
|
Content
Gets the contents of HTTP response, if it is available.
Declaration
public virtual BinaryData Content { get; }
Property Value
System.BinaryData
|
Remarks
Throws System.InvalidOperationException when ContentStream is not a System.IO.MemoryStream.
ContentStream
Gets the contents of HTTP response. Returns null
for responses without content.
Declaration
public abstract System.IO.Stream ContentStream { get; set; }
Property Value
System.IO.Stream
|
Headers
Get the HTTP response headers.
Declaration
public virtual Azure.Core.ResponseHeaders Headers { get; }
Property Value
ResponseHeaders
|
IsError
Indicates whether the status code of the returned response is considered an error code.
Declaration
public virtual bool IsError { get; }
Property Value
System.Boolean
|
ReasonPhrase
Gets the HTTP reason phrase.
Declaration
public abstract string ReasonPhrase { get; }
Property Value
System.String
|
Status
Gets the HTTP status code.
Declaration
public abstract int Status { get; }
Property Value
System.Int32
|
Methods
ContainsHeader(String)
Returns true
if the header is stored in the collection.
Declaration
protected internal abstract bool ContainsHeader (string name);
Parameters
System.String
name
The header name. |
Returns
System.Boolean
|
Dispose()
EnumerateHeaders()
Returns an iterator for enumerating HttpHeader in the response.
Declaration
protected internal abstract System.Collections.Generic.IEnumerable<Azure.Core.HttpHeader> EnumerateHeaders ();
Returns
System.Collections.Generic.IEnumerable<HttpHeader>
The System.Collections.Generic.IEnumerable enumerating HttpHeader in the response. |
FromValue<T>(T, Response)
Creates a new instance of Response<T> with the provided value and HTTP response.
Declaration
public static Azure.Response<T> FromValue<T> (T value, Azure.Response response);
Parameters
value
The value. |
Response
response
The HTTP response. |
Returns
Response<T>
A new instance of Response<T> with the provided value and HTTP response. |
Type Parameters
T
The type of the value. |
ToString()
Returns the string representation of this Response.
Declaration
public override string ToString ();
Returns
System.String
The string representation of this Response |
TryGetHeader(String, String)
Returns header value if the header is stored in the collection. If header has multiple values they are going to be joined with a comma.
Declaration
protected internal abstract bool TryGetHeader (string name, out string value);
Parameters
System.String
name
The header name. |
System.String
value
The reference to populate with value. |
Returns
System.Boolean
|
TryGetHeaderValues(String, IEnumerable<String>)
Returns header values if the header is stored in the collection.
Declaration
protected internal abstract bool TryGetHeaderValues (string name, out System.Collections.Generic.IEnumerable<string> values);
Parameters
System.String
name
The header name. |
System.Collections.Generic.IEnumerable<System.String>
values
The reference to populate with values. |
Returns
System.Boolean
|