Class ServiceHeaderUtils
Helper methods for managing HTTP headers.
Inherited Members
Namespace: Unity.Cloud.Common
Syntax
public static class ServiceHeaderUtils
Fields
k_ApiSourceHeader
Declaration
public const string k_ApiSourceHeader = "X-Unity-Cloud-Api-Source"
Field Value
Type | Description |
---|---|
String |
k_UnityApiPattern
Declaration
public const string k_UnityApiPattern = "https.*(?:[./])unity\\.com/api/.*|localhost:.*\\/api/.*"
Field Value
Type | Description |
---|---|
String |
Methods
AddAppIdAndClientTrace(HttpHeaders, String, String)
Adds the HTTP headers with specific values for app Id and client trace.
Declaration
public static void AddAppIdAndClientTrace(this HttpHeaders headers, string appId, string clientTrace)
Parameters
Type | Name | Description |
---|---|---|
HttpHeaders | headers | The HTTP headers to add to. |
String | appId | The app Id. |
String | clientTrace | The client trace. |
AddAuthorization(HttpHeaders, String)
Add the HTTP header with a specific value for authorization.
Declaration
public static void AddAuthorization(this HttpHeaders headers, string auth)
Parameters
Type | Name | Description |
---|---|---|
HttpHeaders | headers | The HTTP headers to add to. |
String | auth | The authorization value. |
AddHeadersAsQuery(Uri, HttpHeaders)
Add HTTP headers to the specified Uri as query arguments.
Declaration
public static Uri AddHeadersAsQuery(this Uri uri, HttpHeaders headers)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | The Uri to add HTTP headers as queries to. |
HttpHeaders | headers | The HTTP headers to append as queries. |
Returns
Type | Description |
---|---|
Uri | The modified Uri. |
GetHeaderValue(ApiSourceVersion)
Returns the data contained in the ApiSourceVersion formatted as a string for the HTTP header value.
Declaration
public static string GetHeaderValue(this ApiSourceVersion apiSourceVersion)
Parameters
Type | Name | Description |
---|---|---|
ApiSourceVersion | apiSourceVersion | The version information with which to generate the header value. |
Returns
Type | Description |
---|---|
String | The contents ApiSourceVersion formatted as a string for the HTTP header value. |