Rest.PostAsync Method

Definition

Overloads

PostAsync(String, WWWForm, Dictionary<String,String>, Int32, Boolean, CertificateHandler, Boolean, CancellationToken)

Rest POST.

C#
public static System.Threading.Tasks.Task<Microsoft.MixedReality.Toolkit.Utilities.Response> PostAsync (string query, UnityEngine.WWWForm formData, System.Collections.Generic.Dictionary<string,string> headers = default, int timeout = -1, bool readResponseData = false, UnityEngine.Networking.CertificateHandler certificateHandler = default, bool disposeCertificateHandlerOnDispose = true, System.Threading.CancellationToken cancellationToken = default);

Parameters

query
String

Finalized Endpoint Query with parameters.

formData
UnityEngine.WWWForm

Form Data.

headers
Dictionary<String,String>

Optional header information for the request.

timeout
Int32

Optional time in seconds before request expires.

readResponseData
Boolean

Optional bool. If its true, response data will be read from web request download handler.

certificateHandler
UnityEngine.Networking.CertificateHandler

Optional certificate handler for custom certificate verification

disposeCertificateHandlerOnDispose
Boolean

Optional bool. If true and certificateHandler is not null, certificateHandler will be disposed, when the underlying UnityWebRequest is disposed.

cancellationToken
CancellationToken

Returns

The response data.

Applies to

MRTK2 Unity 2019 2.8.0 and MRTK2 Unity 2020 2.8.0
Product Versions
MRTK2 Unity 2019 2.8.0
MRTK2 Unity 2020 2.8.0

PostAsync(String, String, Dictionary<String,String>, Int32, Boolean, CertificateHandler, Boolean, CancellationToken)

Rest POST.

C#
public static System.Threading.Tasks.Task<Microsoft.MixedReality.Toolkit.Utilities.Response> PostAsync (string query, string jsonData, System.Collections.Generic.Dictionary<string,string> headers = default, int timeout = -1, bool readResponseData = false, UnityEngine.Networking.CertificateHandler certificateHandler = default, bool disposeCertificateHandlerOnDispose = true, System.Threading.CancellationToken cancellationToken = default);

Parameters

query
String

Finalized Endpoint Query with parameters.

jsonData
String

JSON data for the request.

headers
Dictionary<String,String>

Optional header information for the request.

timeout
Int32

Optional time in seconds before request expires.

readResponseData
Boolean

Optional bool. If its true, response data will be read from web request download handler.

certificateHandler
UnityEngine.Networking.CertificateHandler

Optional certificate handler for custom certificate verification

disposeCertificateHandlerOnDispose
Boolean

Optional bool. If true and certificateHandler is not null, certificateHandler will be disposed, when the underlying UnityWebRequest is disposed.

cancellationToken
CancellationToken

Returns

The response data.

Applies to

MRTK2 Unity 2019 2.8.0 and MRTK2 Unity 2020 2.8.0
Product Versions
MRTK2 Unity 2019 2.8.0
MRTK2 Unity 2020 2.8.0

PostAsync(String, Byte[], Dictionary<String,String>, Int32, Boolean, CertificateHandler, Boolean, CancellationToken)

Rest POST.

C#
public static System.Threading.Tasks.Task<Microsoft.MixedReality.Toolkit.Utilities.Response> PostAsync (string query, byte[] bodyData, System.Collections.Generic.Dictionary<string,string> headers = default, int timeout = -1, bool readResponseData = false, UnityEngine.Networking.CertificateHandler certificateHandler = default, bool disposeCertificateHandlerOnDispose = true, System.Threading.CancellationToken cancellationToken = default);

Parameters

query
String

Finalized Endpoint Query with parameters.

bodyData
Byte[]

The raw data to post.

headers
Dictionary<String,String>

Optional header information for the request.

timeout
Int32

Optional time in seconds before request expires.

readResponseData
Boolean

Optional bool. If its true, response data will be read from web request download handler.

certificateHandler
UnityEngine.Networking.CertificateHandler

Optional certificate handler for custom certificate verification

disposeCertificateHandlerOnDispose
Boolean

Optional bool. If true and certificateHandler is not null, certificateHandler will be disposed, when the underlying UnityWebRequest is disposed.

cancellationToken
CancellationToken

Returns

The response data.

Applies to

MRTK2 Unity 2019 2.8.0 and MRTK2 Unity 2020 2.8.0
Product Versions
MRTK2 Unity 2019 2.8.0
MRTK2 Unity 2020 2.8.0

PostAsync(String, WWWForm, Dictionary<String,String>, Int32, Boolean, CertificateHandler, Boolean)

Rest POST.

C#
public static System.Threading.Tasks.Task<Microsoft.MixedReality.Toolkit.Utilities.Response> PostAsync (string query, UnityEngine.WWWForm formData, System.Collections.Generic.Dictionary<string,string> headers = default, int timeout = -1, bool readResponseData = false, UnityEngine.Networking.CertificateHandler certificateHandler = default, bool disposeCertificateHandlerOnDispose = true);

Parameters

query
String

Finalized Endpoint Query with parameters.

formData
UnityEngine.WWWForm

Form Data.

headers
Dictionary<String,String>

Optional header information for the request.

timeout
Int32

Optional time in seconds before request expires.

readResponseData
Boolean

Optional bool. If its true, response data will be read from web request download handler.

certificateHandler
UnityEngine.Networking.CertificateHandler

Optional certificate handler for custom certificate verification

disposeCertificateHandlerOnDispose
Boolean

Optional bool. If true and certificateHandler is not null, certificateHandler will be disposed, when the underlying UnityWebRequest is disposed.

Returns

The response data.

Applies to

MRTK2 Unity 2018 2.7.0 and other versions
Product Versions
MRTK2 Unity 2018 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2019 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2020 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0

PostAsync(String, Dictionary<String,String>, Int32, Boolean, CertificateHandler, Boolean, CancellationToken)

Rest POST.

C#
public static System.Threading.Tasks.Task<Microsoft.MixedReality.Toolkit.Utilities.Response> PostAsync (string query, System.Collections.Generic.Dictionary<string,string> headers = default, int timeout = -1, bool readResponseData = false, UnityEngine.Networking.CertificateHandler certificateHandler = default, bool disposeCertificateHandlerOnDispose = true, System.Threading.CancellationToken cancellationToken = default);

Parameters

query
String

Finalized Endpoint Query with parameters.

headers
Dictionary<String,String>

Optional header information for the request.

timeout
Int32

Optional time in seconds before request expires.

readResponseData
Boolean

Optional bool. If its true, response data will be read from web request download handler.

certificateHandler
UnityEngine.Networking.CertificateHandler

Optional certificate handler for custom certificate verification

disposeCertificateHandlerOnDispose
Boolean

Optional bool. If true and certificateHandler is not null, certificateHandler will be disposed, when the underlying UnityWebRequest is disposed.

cancellationToken
CancellationToken

Returns

The response data.

Applies to

MRTK2 Unity 2019 2.8.0 and MRTK2 Unity 2020 2.8.0
Product Versions
MRTK2 Unity 2019 2.8.0
MRTK2 Unity 2020 2.8.0

PostAsync(String, Byte[], Dictionary<String,String>, Int32, Boolean, CertificateHandler, Boolean)

Rest POST.

C#
public static System.Threading.Tasks.Task<Microsoft.MixedReality.Toolkit.Utilities.Response> PostAsync (string query, byte[] bodyData, System.Collections.Generic.Dictionary<string,string> headers = default, int timeout = -1, bool readResponseData = false, UnityEngine.Networking.CertificateHandler certificateHandler = default, bool disposeCertificateHandlerOnDispose = true);

Parameters

query
String

Finalized Endpoint Query with parameters.

bodyData
Byte[]

The raw data to post.

headers
Dictionary<String,String>

Optional header information for the request.

timeout
Int32

Optional time in seconds before request expires.

readResponseData
Boolean

Optional bool. If its true, response data will be read from web request download handler.

certificateHandler
UnityEngine.Networking.CertificateHandler

Optional certificate handler for custom certificate verification

disposeCertificateHandlerOnDispose
Boolean

Optional bool. If true and certificateHandler is not null, certificateHandler will be disposed, when the underlying UnityWebRequest is disposed.

Returns

The response data.

Applies to

MRTK2 Unity 2018 2.7.0 and other versions
Product Versions
MRTK2 Unity 2018 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2019 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2020 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0

PostAsync(String, Dictionary<String,String>, Int32, Boolean, CertificateHandler, Boolean)

Rest POST.

C#
public static System.Threading.Tasks.Task<Microsoft.MixedReality.Toolkit.Utilities.Response> PostAsync (string query, System.Collections.Generic.Dictionary<string,string> headers = default, int timeout = -1, bool readResponseData = false, UnityEngine.Networking.CertificateHandler certificateHandler = default, bool disposeCertificateHandlerOnDispose = true);

Parameters

query
String

Finalized Endpoint Query with parameters.

headers
Dictionary<String,String>

Optional header information for the request.

timeout
Int32

Optional time in seconds before request expires.

readResponseData
Boolean

Optional bool. If its true, response data will be read from web request download handler.

certificateHandler
UnityEngine.Networking.CertificateHandler

Optional certificate handler for custom certificate verification

disposeCertificateHandlerOnDispose
Boolean

Optional bool. If true and certificateHandler is not null, certificateHandler will be disposed, when the underlying UnityWebRequest is disposed.

Returns

The response data.

Applies to

MRTK2 Unity 2018 2.7.0 and other versions
Product Versions
MRTK2 Unity 2018 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2019 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2020 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0

PostAsync(String, String, Dictionary<String,String>, Int32, Boolean, CertificateHandler, Boolean)

Rest POST.

C#
public static System.Threading.Tasks.Task<Microsoft.MixedReality.Toolkit.Utilities.Response> PostAsync (string query, string jsonData, System.Collections.Generic.Dictionary<string,string> headers = default, int timeout = -1, bool readResponseData = false, UnityEngine.Networking.CertificateHandler certificateHandler = default, bool disposeCertificateHandlerOnDispose = true);

Parameters

query
String

Finalized Endpoint Query with parameters.

jsonData
String

JSON data for the request.

headers
Dictionary<String,String>

Optional header information for the request.

timeout
Int32

Optional time in seconds before request expires.

readResponseData
Boolean

Optional bool. If its true, response data will be read from web request download handler.

certificateHandler
UnityEngine.Networking.CertificateHandler

Optional certificate handler for custom certificate verification

disposeCertificateHandlerOnDispose
Boolean

Optional bool. If true and certificateHandler is not null, certificateHandler will be disposed, when the underlying UnityWebRequest is disposed.

Returns

The response data.

Applies to

MRTK2 Unity 2018 2.7.0 and other versions
Product Versions
MRTK2 Unity 2018 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2019 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2020 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0