Handles a deserialized HTTP response.
Inheritance Hierarchy
DocuWare.Services.HttpDeserializedHttpResponseT
Namespace: DocuWare.Services.Http
Assembly: DocuWare.RestClient (in DocuWare.RestClient.dll) Version: Version 6.6
Syntax
C#
public class DeserializedHttpResponse<T> : IDisposable
Type Parameters
- T
- The type of the encapsulated response.
The DeserializedHttpResponseT type exposes the following members.
Constructors
Name | Description | |
---|---|---|
DeserializedHttpResponseT |
Initializes a new instance of the DeserializedHttpResponseT class.
|
Methods
Name | Description | |
---|---|---|
Dispose |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
| |
Finalize |
Finalizes an instance of the DeserializedHttpResponseT class.
(Overrides ObjectFinalize.) |
Operators
Name | Description | |
---|---|---|
(DeserializedHttpResponseT to T) |
Converts the specified response.
|
Properties
Name | Description | |
---|---|---|
Content |
Gets the deserialized content of the response body.
| |
ContentHeaders |
Gets the content headers.
| |
Exception |
Gets the exception in case the request failed.
| |
Headers |
Gets the response headers.
| |
IsSuccessStatusCode |
Gets a value indicating whether the response was successful.
| |
RequestUri |
Gets the request URI.
| |
StatusCode |
Gets the response status code.
|
Remarks
- A String will cause the HTTP response message content to be read as string.
- A XElement will cause the HTTP response message content to be read as XElement. There might exceptions be thrown in case the response content is not a valid XML.
- A Stream will cause the HTTP response message content to be read as Stream. The response content is read streaming, that is, you can consume arbitrary large streams. You should always call Close after you finished reading the stream in order to close the HTTP connection.
- FOr any other values of T the response content is deserialized into an intance of type T. If the deserialization step fails, the XmlSerializer throws exceptions.
See Also