Interface IHttpConnection
Interface to handle HTTP connection
Namespace: Pixiv.VroidSdk.Networking.Connections
Assembly: Pixiv.VroidSdk.dll
Syntax
public interface IHttpConnection
Properties
Header
HTTP request header
Declaration
IHttpHeader Header { get; set; }
Property Value
Type | Description |
---|---|
IHttpHeader |
OnDownloadProgressChanged
Callback on download progression
Declaration
Action<float> OnDownloadProgressChanged { get; set; }
Property Value
Type | Description |
---|---|
Action<Single> |
OnUploadProgressChanged
Callback on upload progression
Declaration
Action<float> OnUploadProgressChanged { get; set; }
Property Value
Type | Description |
---|---|
Action<Single> |
Param
HTTP request parameter
Declaration
IHttpParam Param { get; set; }
Property Value
Type | Description |
---|---|
IHttpParam |
Url
URL
Declaration
IHttpUrl Url { get; }
Property Value
Type | Description |
---|---|
IHttpUrl |
Methods
BuildUrl()
Return URL containing query parameter
Declaration
string BuildUrl()
Returns
Type | Description |
---|---|
String | URL string |
DeleteAsync()
Carry out DELETE request
Declaration
Task<IHttpResponse> DeleteAsync()
Returns
Type | Description |
---|---|
Task<IHttpResponse> | DELETE request response |
Exceptions
Type | Condition |
---|---|
HttpRequestFailedException | HTTP request failure |
DeleteAsync(Action<IHttpResponse>, Action<HttpRequestFailedException>)
Carry out DELETE request
Declaration
void DeleteAsync(Action<IHttpResponse> onSuccess, Action<HttpRequestFailedException> onError)
Parameters
Type | Name | Description |
---|---|---|
Action<IHttpResponse> | onSuccess | Callback on success |
Action<HttpRequestFailedException> | onError | Callback on failure |
GetAsync()
Carry out GET request
Declaration
Task<IHttpResponse> GetAsync()
Returns
Type | Description |
---|---|
Task<IHttpResponse> | GET request response |
Exceptions
Type | Condition |
---|---|
HttpRequestFailedException | HTTP request failure |
GetAsync(Action<IHttpResponse>, Action<HttpRequestFailedException>)
Carry out GET request
Declaration
void GetAsync(Action<IHttpResponse> onSuccess, Action<HttpRequestFailedException> onError)
Parameters
Type | Name | Description |
---|---|---|
Action<IHttpResponse> | onSuccess | Callback on success |
Action<HttpRequestFailedException> | onError | Callback on failure |
PostAsync()
Cary out Post request
Declaration
Task<IHttpResponse> PostAsync()
Returns
Type | Description |
---|---|
Task<IHttpResponse> | Post request response |
Exceptions
Type | Condition |
---|---|
HttpRequestFailedException | HTTP request failure |
PostAsync(Action<IHttpResponse>, Action<HttpRequestFailedException>)
Carry out POST request
Declaration
void PostAsync(Action<IHttpResponse> onSuccess, Action<HttpRequestFailedException> onError)
Parameters
Type | Name | Description |
---|---|---|
Action<IHttpResponse> | onSuccess | Callback on success |
Action<HttpRequestFailedException> | onError | Callback on failure |
PutAsync()
Carry out PUT request
Declaration
Task<IHttpResponse> PutAsync()
Returns
Type | Description |
---|---|
Task<IHttpResponse> | PUT request response |
Exceptions
Type | Condition |
---|---|
HttpRequestFailedException | HTTP request failure |
PutAsync(Action<IHttpResponse>, Action<HttpRequestFailedException>)
Carry out PUT request
Declaration
void PutAsync(Action<IHttpResponse> onSuccess, Action<HttpRequestFailedException> onError)
Parameters
Type | Name | Description |
---|---|---|
Action<IHttpResponse> | onSuccess | Callback on success |
Action<HttpRequestFailedException> | onError | Callback on failure |