Show / Hide Table of Contents

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 Source

DeleteAsync<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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

| Improve this Doc View Source

UpdateHttpClient(Action<HttpClient>)

Updates HttpClient used within IRestClient

Declaration
void UpdateHttpClient(Action<HttpClient> updateHttpClient)
Parameters
Type Name Description
Action<HttpClient> updateHttpClient

Extension Methods

RestClientExtensions.TryDeleteAsync<T>(IRestClient, String)
RestClientExtensions.TryGetAsync<T>(IRestClient, String)
RestClientExtensions.TryPatchAsync<T>(IRestClient, String, Object)
RestClientExtensions.TryPostAsync<T>(IRestClient, String, Object)
RestClientExtensions.TryPutAsync<T>(IRestClient, String, Object)
RestClientExtensions.TryDeleteTaskAsync(IRestClient, String)
RestClientExtensions.TryPatchTaskAsync(IRestClient, String, Object)
RestClientExtensions.TryPostTaskAsync(IRestClient, String, Object)
RestClientExtensions.TryPutTaskAsync(IRestClient, String, Object)
RestClientExtensions.DeleteAsync<T>(IRestClient, Action<IRestClientUrlBuilder>)
RestClientExtensions.DeleteTaskAsync(IRestClient, Action<IRestClientUrlBuilder>)
RestClientExtensions.TryDeleteAsync<T>(IRestClient, Action<IRestClientUrlBuilder>)
RestClientExtensions.TryDeleteTaskAsync(IRestClient, Action<IRestClientUrlBuilder>)
RestClientExtensions.GetAsync<T>(IRestClient, Action<IRestClientUrlBuilder>)
RestClientExtensions.TryGetAsync<T>(IRestClient, Action<IRestClientUrlBuilder>)
RestClientExtensions.PatchAsync<T>(IRestClient, Action<IRestClientUrlBuilder>, Object)
RestClientExtensions.PatchTaskAsync(IRestClient, Action<IRestClientUrlBuilder>, Object)
RestClientExtensions.TryPatchAsync<T>(IRestClient, Action<IRestClientUrlBuilder>, Object)
RestClientExtensions.TryPatchTaskAsync(IRestClient, Action<IRestClientUrlBuilder>, Object)
RestClientExtensions.PostAsync<T>(IRestClient, Action<IRestClientUrlBuilder>, Object)
RestClientExtensions.PostTaskAsync(IRestClient, Action<IRestClientUrlBuilder>, Object)
RestClientExtensions.TryPostAsync<T>(IRestClient, Action<IRestClientUrlBuilder>, Object)
RestClientExtensions.TryPostTaskAsync(IRestClient, Action<IRestClientUrlBuilder>, Object)
RestClientExtensions.PutAsync<T>(IRestClient, Action<IRestClientUrlBuilder>, Object)
RestClientExtensions.PutTaskAsync(IRestClient, Action<IRestClientUrlBuilder>, Object)
RestClientExtensions.TryPutAsync<T>(IRestClient, Action<IRestClientUrlBuilder>, Object)
RestClientExtensions.TryPutTaskAsync(IRestClient, Action<IRestClientUrlBuilder>, Object)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX