docs.unity3d.com
    Show / Hide Table of Contents

    Class ServiceHeaderUtils

    Helper methods for managing HTTP headers.

    Inheritance
    Object
    ServiceHeaderUtils
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    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.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023