Class WebResponse<T>
Container object which is produced by IContentLoader classes after they fetched content from the Web
Namespace: i5.Toolkit.Core.Utilities
Assembly: cs.temp.dll.dll
Syntax
public class WebResponse<T>
Type Parameters
Name | Description |
---|---|
T | The return type of the WebResponse |
Constructors
WebResponse(T, Byte[], Int64)
Creates a successul WebResponse with the given content and code
Declaration
public WebResponse(T content, byte[] byteData, long code)
Parameters
Type | Name | Description |
---|---|---|
T | content | The content of the Web request's response |
Byte[] | byteData | The byte data of the response body |
Int64 | code | The response code |
WebResponse(Boolean, T, Byte[], Int64, String)
Creates a new WebResponse object
Declaration
public WebResponse(bool successful, T content, byte[] byteData, long code, string errorMessage)
Parameters
Type | Name | Description |
---|---|---|
Boolean | successful | States whether the request was successful |
T | content | Contains the content of the response |
Byte[] | byteData | Contains the byte data of the response body |
Int64 | code | The response code |
String | errorMessage | Any error messages that might have occurred |
WebResponse(String, Int64)
Creates a failed WebResponse with the specified error message and code
Declaration
public WebResponse(string errorMessage, long code)
Parameters
Type | Name | Description |
---|---|---|
String | errorMessage | The error message |
Int64 | code | The response code |
Properties
ByteData
Byte data of the Web requests response body
Declaration
public byte[] ByteData { get; }
Property Value
Type | Description |
---|---|
Byte[] |
Code
The response code of the Web request
Declaration
public long Code { get; }
Property Value
Type | Description |
---|---|
Int64 |
Content
Contains the content of the Web request Set to default value if the Web request failed
Declaration
public T Content { get; }
Property Value
Type | Description |
---|---|
T |
ErrorMessage
An error message if any occurred
Declaration
public string ErrorMessage { get; }
Property Value
Type | Description |
---|---|
String |
Successful
Set to true if the Web request was successful
Declaration
public bool Successful { get; }
Property Value
Type | Description |
---|---|
Boolean |