resourceRequest
Resources can be fetched using user authentication, implicit authentication and anonymous authentication or while being unauthenticated. Refer to Secure resource access for more information about the differences between these types of requests.
Future<RequestResponse> requestResource(type: ResourceRequestType, details: RequestDetails): RequestResponse
Additionally, we left the functions to directly perform the different types of resource requests using:
requestResourceAuthenticated(details: RequestDetails): RequestResponse
( requires user authentication)requestResourceImplicit(details: RequestDetails): RequestResponse
(requires implicit authentication)requestResourceAnonymous(details: RequestDetails): RequestResponse
(requires anonymous authentication)requestResourceUnauthenticated(details: RequestDetails): RequestResponse
` (requires no authentication)
Documentation for RequestDetails and RequestResponse can be found on their respective pages.
Example
An example using the resourceRequest
method to perform a anonymous GET request:
ResourceRequestType
As described in Secure resource access, there are multiple modes to request resources with which will or will not require the user to be authenticated. The mode can be set using the ResourceRequestType
enum type: