C# Class ConoHaNet.Extensions.ResponseExtensions

Contains extension methods to the Response class.
Mostra file Open project: crowdy/OpenStack-ConoHa

Public Methods

Method Description
HasJsonBody ( this response ) : bool

This method checks if a REST Response contains a JSON-formatted body. The response is assumed to be JSON if the content type is reported as application/json and the body is not empty.

TryGetHeader ( this response, HttpResponseHeader header, string &value ) : bool

Retrieves a standard HTTP response header from a REST response, if available.

TryGetHeader ( this response, string header, string &value ) : bool

Retrieves a custom HTTP response header from a REST response, if available.

Method Details

HasJsonBody() public static method

This method checks if a REST Response contains a JSON-formatted body. The response is assumed to be JSON if the content type is reported as application/json and the body is not empty.
public static HasJsonBody ( this response ) : bool
response this The REST response.
return bool

TryGetHeader() public static method

Retrieves a standard HTTP response header from a REST response, if available.
is .
public static TryGetHeader ( this response, HttpResponseHeader header, string &value ) : bool
response this The REST response.
header HttpResponseHeader The header to retrieve.
value string Returns the value for .
return bool

TryGetHeader() public static method

Retrieves a custom HTTP response header from a REST response, if available.
is .
public static TryGetHeader ( this response, string header, string &value ) : bool
response this The REST response.
header string The header to retrieve.
value string Returns the value for .
return bool