Skip to content
This repository was archived by the owner on Feb 16, 2024. It is now read-only.

BlazoradeRequestFactory

Mika Berglund edited this page Feb 28, 2022 · 4 revisions

BlazoradeRequestFactory Class

This service class is used to create HttpRequestMessage objects that have the Authorization header set to bearer with an access token acquired from the BlazoradeMsalService class.

This class is added to your application's service collection when you configure Blazorade MSAL as described in the getting started section.

Methods

This service class exposes the following methods. All methods that return an HttpRequestMessage object will also set the Authorization header on the returned instance.

CreateRequestAsync(CreateRequestOptions)

Creates a request object from the given options.

Parameters

Name Type Description
options CreateRequestOptions The options that control how the request is created.

Returns

Task<HttpRequestMessage>

CreateRequestAsync(Uri, HttpMethod, params string[])

Creates a request from the given parameters.

Parameters

Name Type Description
requestUri Uri The URI to send the request to.
method HttpMethod The method to set on the request.
scopes string[] A collection of scopes that the acquired access token must at least have.

Returns

Task<HttpRequestMessage>

CreateRequestAsync(string, HttpMethod, params string[])

Creates a request from the given parameters.

Parameters

Name Type Description
requestUri Uri The URI to send the request to.
method HttpMethod The method to set on the request.
scopes string[] A collection of scopes that the acquired access token must at least have.

Returns

Task<HttpRequestMessage>

CreateDeleteRequestAsync(Uri, params string[])

Creates a DELETE request from the given parameters.

Parameters

Name Type Description
requestUri Uri The URI to send the request to.
scopes string[] A collection of scopes that the acquired access token must at least have.

Returns

Task<HttpRequestMessage>

CreateDeleteRequestAsync(string, params string[])

Creates a DELETE request from the given parameters.

Parameters

Name Type Description
requestUri Uri The URI to send the request to.
scopes string[] A collection of scopes that the acquired access token must at least have.

Returns

Task<HttpRequestMessage>

CreateGetRequestAsync(Uri, params string[])

Creates a GET request from the given parameters.

Parameters

Name Type Description
requestUri Uri The URI to send the request to.
scopes string[] A collection of scopes that the acquired access token must at least have.

Returns

Task<HttpRequestMessage>

CreateGetRequestAsync(string, params string[])

Creates a GET request from the given parameters.

Parameters

Name Type Description
requestUri Uri The URI to send the request to.
scopes string[] A collection of scopes that the acquired access token must at least have.

Returns

Task<HttpRequestMessage>

CreatePatchRequestAsync(Uri, params string[])

Creates a PATCH request from the given parameters.

Parameters

Name Type Description
requestUri Uri The URI to send the request to.
scopes string[] A collection of scopes that the acquired access token must at least have.

Returns

Task<HttpRequestMessage>

CreatePatchRequestAsync(string, params string[])

Creates a PATCH request from the given parameters.

Parameters

Name Type Description
requestUri Uri The URI to send the request to.
scopes string[] A collection of scopes that the acquired access token must at least have.

Returns

Task<HttpRequestMessage>

CreatePostRequestAsync(Uri, params string[])

Creates a POST request from the given parameters.

Parameters

Name Type Description
requestUri Uri The URI to send the request to.
scopes string[] A collection of scopes that the acquired access token must at least have.

Returns

Task<HttpRequestMessage>

CreatePostRequestAsync(string, params string[])

Creates a POST request from the given parameters.

Parameters

Name Type Description
requestUri Uri The URI to send the request to.
scopes string[] A collection of scopes that the acquired access token must at least have.

Returns

Task<HttpRequestMessage>

CreatePutRequestAsync(Uri, params string[])

Creates a PUT request from the given parameters.

Parameters

Name Type Description
requestUri Uri The URI to send the request to.
scopes string[] A collection of scopes that the acquired access token must at least have.

Returns

Task<HttpRequestMessage>

CreatePutRequestAsync(string, params string[])

Creates a PUT request from the given parameters.

Parameters

Name Type Description
requestUri Uri The URI to send the request to.
scopes string[] A collection of scopes that the acquired access token must at least have.

Returns

Task<HttpRequestMessage>

Clone this wiki locally