Class RCUnityWebRequest
RC UnityWebRequest class, used to make web requests.
Implements
Inherited Members
Namespace: Unity.Services.RemoteConfig
Assembly: Unity.Services.RemoteConfig.dll
Syntax
public class RCUnityWebRequest : IRCUnityWebRequest
Properties
certificateHandler
Holds a reference to a CertificateHandler object, which manages certificate validation for this UnityWebRequest.
Declaration
public CertificateHandler certificateHandler { get; set; }
Property Value
| Type | Description |
|---|---|
| CertificateHandler |
disposeCertificateHandlerOnDispose
If true, any CertificateHandler attached to this UnityWebRequest will have CertificateHandler.Dispose called automatically when UnityWebRequest.Dispose is called.
Declaration
public bool disposeCertificateHandlerOnDispose { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
disposeDownloadHandlerOnDispose
If true, any DownloadHandler attached to this UnityWebRequest will have DownloadHandler.Dispose called automatically when UnityWebRequest.Dispose is called.
Declaration
public bool disposeDownloadHandlerOnDispose { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
disposeUploadHandlerOnDispose
If true, any UploadHandler attached to this UnityWebRequest will have UploadHandler.Dispose called automatically when UnityWebRequest.Dispose is called.
Declaration
public bool disposeUploadHandlerOnDispose { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
downloadHandler
Holds a reference to a DownloadHandler object, which manages body data received from the remote server by this UnityWebRequest.
Declaration
public DownloadHandler downloadHandler { get; set; }
Property Value
| Type | Description |
|---|---|
| DownloadHandler |
downloadProgress
Returns a floating-point value between 0.0 and 1.0, indicating the progress of downloading body data from the server. (Read Only)
Declaration
public float downloadProgress { get; }
Property Value
| Type | Description |
|---|---|
| float |
downloadedBytes
Returns the number of bytes of body data the system has downloaded from the remote server. (Read Only)
Declaration
public ulong downloadedBytes { get; }
Property Value
| Type | Description |
|---|---|
| ulong |
error
A human-readable string describing any system errors encountered by this UnityWebRequest object while handling HTTP requests or responses. (Read Only)
Declaration
public string error { get; }
Property Value
| Type | Description |
|---|---|
| string |
isDone
Returns true after the UnityWebRequest has finished communicating with the remote server. (Read Only)
Declaration
public bool isDone { get; }
Property Value
| Type | Description |
|---|---|
| bool |
isHttpError
Returns true after this UnityWebRequest receives an HTTP response code indicating an error. (Read Only)
Declaration
public bool isHttpError { get; }
Property Value
| Type | Description |
|---|---|
| bool |
isModifiable
Boolean value to represent if the UnityWebRequest's configuration properties can be altered.
Declaration
public bool isModifiable { get; }
Property Value
| Type | Description |
|---|---|
| bool |
isNetworkError
Returns true after this UnityWebRequest encounters a system error. (Read Only)
Declaration
public bool isNetworkError { get; }
Property Value
| Type | Description |
|---|---|
| bool |
method
Defines the HTTP verb used by this UnityWebRequest, such as GET or POST.
Declaration
public string method { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
redirectLimit
Indicates the number of redirects which this UnityWebRequest will follow before halting with a “Redirect Limit Exceeded” system error.
Declaration
public int redirectLimit { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
responseCode
The numeric HTTP response code returned by the server, such as 200, 404 or 500. (Read Only)
Declaration
public long responseCode { get; }
Property Value
| Type | Description |
|---|---|
| long |
timeout
Sets UnityWebRequest to attempt to abort after the number of seconds in timeout have passed.
Declaration
public int timeout { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
unityWebRequest
UnityWebRequest object handles the flow of HTTP communication with web servers
Declaration
public UnityWebRequest unityWebRequest { get; set; }
Property Value
| Type | Description |
|---|---|
| UnityWebRequest |
uploadHandler
Holds a reference to the UploadHandler object which manages body data to be uploaded to the remote server.
Declaration
public UploadHandler uploadHandler { get; set; }
Property Value
| Type | Description |
|---|---|
| UploadHandler |
uploadProgress
The float value indicating the progress of uploading progress.
Declaration
public float uploadProgress { get; }
Property Value
| Type | Description |
|---|---|
| float |
uploadedBytes
Returns the number of bytes of body data the system has uploaded to the remote server. (Read Only)
Declaration
public ulong uploadedBytes { get; }
Property Value
| Type | Description |
|---|---|
| ulong |
uri
Defines the target URI for the UnityWebRequest to communicate with.
Declaration
public Uri uri { get; set; }
Property Value
| Type | Description |
|---|---|
| Uri |
url
Defines the target URL for the UnityWebRequest to communicate with.
Declaration
public string url { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
useHttpContinue
Determines whether this UnityWebRequest will include Expect: 100-Continue in its outgoing request headers. (Default: true).
Declaration
public bool useHttpContinue { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
Abort()
If in progress, halts the UnityWebRequest as soon as possible.
Declaration
public void Abort()
Dispose()
Signals that this UnityWebRequest is no longer being used, and should clean up any resources it is using.
Declaration
public void Dispose()
GetRequestHeader(string)
Retrieves the value of a custom request header.
Declaration
public string GetRequestHeader(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Name of the custom request header. Case-insensitive. |
Returns
| Type | Description |
|---|---|
| string | The value of the custom request header. If no custom header with a matching name has been set, returns an empty string. |
GetResponseHeader(string)
Retrieves the value of a response header from the latest HTTP response received.
Declaration
public string GetResponseHeader(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the HTTP header to retrieve. Case-insensitive. |
Returns
| Type | Description |
|---|---|
| string | The value of the HTTP header from the latest HTTP response. If no header with a matching name has been received, or no responses have been received, returns null. |
GetResponseHeaders()
Retrieves a dictionary containing all the response headers received by this UnityWebRequest in the latest HTTP response.
Declaration
public Dictionary<string, string> GetResponseHeaders()
Returns
| Type | Description |
|---|---|
| Dictionary<string, string> | A dictionary containing all the response headers received in the latest HTTP response. If no responses have been received, returns null. |
SendWebRequest()
Begin communicating with the remote server.
Declaration
public UnityWebRequestAsyncOperation SendWebRequest()
Returns
| Type | Description |
|---|---|
| UnityWebRequestAsyncOperation | A UnityWebRequestAsyncOperation which can be yielded on to wait for the request to complete. |
SetRequestHeader(string, string)
Set a HTTP request header to a custom value.
Declaration
public void SetRequestHeader(string name, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The key of the header to be set. Case-sensitive. |
| string | value | The header's intended value. |