Class WebResponse<T>
Container object which is produced by IContentLoader classes after they fetched content from the Web
Inheritance
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[], long)
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 |
long | code | The response code |
WebResponse(bool, T, byte[], long, string)
Creates a new WebResponse object
Declaration
public WebResponse(bool successful, T content, byte[] byteData, long code, string errorMessage)
Parameters
Type | Name | Description |
---|---|---|
bool | 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 |
long | code | The response code |
string | errorMessage | Any error messages that might have occurred |
WebResponse(string, long)
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 |
long | 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 |
---|---|
long |
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 |
---|---|
bool |