Interface IRestClient
Standardizes the handling of HTTP requests/responses within a given application.
Namespace: BlazorFocused
Assembly: BlazorFocused.Client.dll
Syntax
public interface IRestClient
Methods
| Improve this Doc View SourceDeleteAsync<T>(String)
Performs DELETE http request
Declaration
Task<T> DeleteAsync<T>(string relativeUrl)
Parameters
Type | Name | Description |
---|---|---|
System.String | relativeUrl | Relative url for http request |
Returns
Type | Description |
---|---|
Task<T> | Http response body of type |
Type Parameters
Name | Description |
---|---|
T | Object type of response from http request |
Remarks
This method will throw an exception for non-success status codes
DeleteTaskAsync(String)
Performs DELETE http request
Declaration
Task DeleteTaskAsync(string relativeUrl)
Parameters
Type | Name | Description |
---|---|---|
System.String | relativeUrl | Relative url for http request |
Returns
Type | Description |
---|---|
Task | Task for completion detection |
Remarks
This method will throw an exception for non-success status codes
GetAsync<T>(String)
Performs GET http request
Declaration
Task<T> GetAsync<T>(string relativeUrl)
Parameters
Type | Name | Description |
---|---|---|
System.String | relativeUrl | Relative url for http request |
Returns
Type | Description |
---|---|
Task<T> | Http response body of type |
Type Parameters
Name | Description |
---|---|
T | Object type of response from http request |
Remarks
This method will throw an exception for non-success status codes
PatchAsync<T>(String, Object)
Performs PATCH http request
Declaration
Task<T> PatchAsync<T>(string relativeUrl, object data)
Parameters
Type | Name | Description |
---|---|---|
System.String | relativeUrl | Relative url for http request |
System.Object | data | Http request object body |
Returns
Type | Description |
---|---|
Task<T> | Http response body of type |
Type Parameters
Name | Description |
---|---|
T | Object type of response from http request |
Remarks
This method will throw an exception for non-success status codes
PatchTaskAsync(String, Object)
Performs PATCH http request
Declaration
Task PatchTaskAsync(string relativeUrl, object data)
Parameters
Type | Name | Description |
---|---|---|
System.String | relativeUrl | Relative url for http request |
System.Object | data | Http request object body |
Returns
Type | Description |
---|---|
Task | Task for completion detection |
Remarks
This method will throw an exception for non-success status codes
PostAsync<T>(String, Object)
Performs POST http request
Declaration
Task<T> PostAsync<T>(string relativeUrl, object data)
Parameters
Type | Name | Description |
---|---|---|
System.String | relativeUrl | Relative url for http request |
System.Object | data | Http request object body |
Returns
Type | Description |
---|---|
Task<T> | Http response body of type |
Type Parameters
Name | Description |
---|---|
T | Object type of response from http request |
Remarks
This method will throw an exception for non-success status codes
PostTaskAsync(String, Object)
Performs POST http request
Declaration
Task PostTaskAsync(string relativeUrl, object data)
Parameters
Type | Name | Description |
---|---|---|
System.String | relativeUrl | Relative url for http request |
System.Object | data | Http request object body |
Returns
Type | Description |
---|---|
Task | Task for completion detection |
Remarks
This method will throw an exception for non-success status codes
PutAsync<T>(String, Object)
Performs PUT http request
Declaration
Task<T> PutAsync<T>(string relativeUrl, object data)
Parameters
Type | Name | Description |
---|---|---|
System.String | relativeUrl | Relative url for http request |
System.Object | data | Http request object body |
Returns
Type | Description |
---|---|
Task<T> | Http response body of type |
Type Parameters
Name | Description |
---|---|
T | Object type of response from http request |
Remarks
This method will throw an exception for non-success status codes
PutTaskAsync(String, Object)
Performs PUT http request
Declaration
Task PutTaskAsync(string relativeUrl, object data)
Parameters
Type | Name | Description |
---|---|---|
System.String | relativeUrl | Relative url for http request |
System.Object | data | Http request object body |
Returns
Type | Description |
---|---|
Task | Task for completion detection |
Remarks
This method will throw an exception for non-success status codes
UpdateHttpClient(Action<HttpClient>)
Updates HttpClient used within IRestClient
Declaration
void UpdateHttpClient(Action<HttpClient> updateHttpClient)
Parameters
Type | Name | Description |
---|---|---|
Action<HttpClient> | updateHttpClient |