Kanda Foundation 0.2.0
Loading...
Searching...
No Matches
UnityWebRequestExtensions Class Reference

A set of extension methods for UnityWebRequest, allowing for a natural method-chaining approach to common request configurations. More...

Static Public Member Functions

static UnityWebRequest WithInMemoryDownloadHandler (this UnityWebRequest request)
 Add an in-memory download handler to the request.
 
static UnityWebRequest WithInMemoryUploadHandler (this UnityWebRequest request, byte[] data)
 Add an in-memory upload handler to the request.
 
static UnityWebRequest WithJsonContentType (this UnityWebRequest request)
 Add Content-Type header with 'application/json' to the request.
 
static UnityWebRequest WithBearerToken (this UnityWebRequest request, string token)
 Add an Authorization header with a given Bearer token to the request.
 
static UnityWebRequest WithFormData (this UnityWebRequest request, WWWForm formData)
 Add a WWWForm to the request.
 
static UnityWebRequest WithTenantIdIfSet (this UnityWebRequest request, IUserSettingsService userSettings)
 Add an x-tenant-id header with a given Tenant ID if it exists in UserSettingsService.
 
static UnityWebRequest WithAzureBlobType (this UnityWebRequest request)
 Add an x-ms-blob-type header with 'BlockBlob' to the request.
 
static IUnityWebRequest Wrap (this UnityWebRequest request)
 Injects the web request into a wrapper that implements an interface, allowing for mocking under test.
 
static bool IsSuccessStatusCode (this IUnityWebRequest request)
 True if the request response code is in the 200 range.
 

Detailed Description

A set of extension methods for UnityWebRequest, allowing for a natural method-chaining approach to common request configurations.


The documentation for this class was generated from the following file: