Version: 2021.2
言語: 日本語

UnityWebRequest

class in UnityEngine.Networking

マニュアルに切り替える

説明

Provides methods to communicate with web servers.

UnityWebRequest handles the flow of HTTP communication with web servers. To download and upload data, use DownloadHandler and UploadHandler respectively.

UnityWebRequest includes static utility functions that return UnityWebRequest instances configured for common use cases. For example: UnityWebRequest.Get UnityWebRequest.Post UnityWebRequest.Put To send a web request from a UnityWebRequest instance, call UnityWebRequest.SendWebRequest. After the UnityWebRequest begins to communicate with a remote server, you can't change any of the properties in that UnityWebRequest instance.

Depending on the platform your application runs on, UnityWebRequest either sets the User-Agent header itself or leaves it for the operating system to set. UnityWebRequest sets the User-Agent header for all platforms except iOS, Xbox platforms, and WebGL.

Note: From Unity 2019.2, UnityWebRequest sets the User-Agent header for Android devices. In earlier releases, the operating system set the User-Agent header.

Note: If the device that the application runs on uses proxy settings, UnityWebRequest applies the proxy settings after the application sends the request.

Static 変数

kHttpVerbCREATE"CREATE" 文字列。通常 HTTP CREATE リクエストの Verb として使用します。
kHttpVerbDELETE"DELETE" 文字列。通常、HTTP DELETE リクエストの Verb として使用します。
kHttpVerbGET"GET" 文字列。通常 HTTP GET リクエストの Verb として使用します。
kHttpVerbHEAD"HEAD" 文字列。通常 HTTP HEAD リクエストの Verb として使用します。
kHttpVerbPOST"POST" 文字列。通常 HTTP POST リクエストの Verb として使用します。
kHttpVerbPUT"PUT" 文字列。通常、HTTP PUT リクエストの Verb として使用します。

変数

certificateHandlerHolds a reference to a CertificateHandler object, which manages certificate validation for this UnityWebRequest.
disposeCertificateHandlerOnDisposeIf true, any CertificateHandler attached to this UnityWebRequest will have CertificateHandler.Dispose called automatically when UnityWebRequest.Dispose is called.
disposeDownloadHandlerOnDisposeTrue の場合、この UnityWebRequest にアタッチされているいずれかの DownloadHandler は、UnityWebRequest.Dispose が呼び出されるとき、自動的に DownloadHandler.Dispose を呼び出します。
disposeUploadHandlerOnDisposeTrue の場合、UnityWebRequest.Dispose が呼び出されたとき、この UnityWebRequest にアタッチされているいずれの UploadHandler は自動的に UploadHandler.Dispose を呼び出します。
downloadedBytesシステムがリモートサーバーからダウンロードしたボディデータのバイト数を返します。
downloadHandlerこの UnityWebRequest でリモートサーバーから受信したデータを管理する DownloadHandler オブジェクトへの参照を保持します。
downloadProgressボディデータをサーバーからダウンロードの進行状況を示す 0.0 と 1.0 の間の浮動小数点値を返します。
errorHTTP リクエストまたはレスポンスを処理中に [UnityWebRequest]] オブジェクトによって発生したシステム エラーを説明する人間が判読できる文字列です。
isDone[UnityWebRequest]] はリモートサーバーとの通信が終了した後、true を返します。
isModifiable UnityWebRequest の設定のプロパティーを変更することができる間、true が返されます。
method GET や POST など、この UnityWebRequest によって使用される HTTP Verb を定義します。
redirectLimitこの UnityWebRequest が「リダイレクト制限を超えた」システムエラーで停止する前にリダイレクトの数を示します。
responseCode 200 、404 、500 などサーバーによって返される数値の HTTP レスポンスコード。
resultThe result of this UnityWebRequest.
timeoutSets UnityWebRequest to attempt to abort after the number of seconds in timeout have passed.
uploadedBytesシステムがリモートサーバーにアップロードしたボディデータのバイト数を返します。
uploadHandlerリモートサーバーにアップロードするデータを管理する UploadHandler オブジェクトへの参照を保持します。
uploadProgressボディデータをサーバーにアップロードする進行状況を示す 0.0 と 1.0 の間の浮動小数点値を返します。
uriDefines the target URI for the UnityWebRequest to communicate with.
url[UnityWebRequest]] と通信するターゲット URL を定義します。
useHttpContinueUnityWebRequest が送信リクエストヘッダーに Expect: 100-Continue を含めるかどうかを決定します(デフォルト: true )。

コンストラクタ

UnityWebRequestデフォルトのオプションと UnityWebRequest を作成し、DownloadHandler または UploadHandler をアタッチしません。デフォルトのメソッドは GET です。

Public 関数

Abort進行中の場合、UnityWebRequest をできるだけ早く停止させます。
DisposeSignals that this UnityWebRequest is no longer being used, and should clean up any resources it is using.
GetRequestHeaderカスタムリクエストヘッダの値を取得します。
GetResponseHeader最新の HTTP レスポンスの受信からレスポンスヘッダーの値を取得します。
GetResponseHeaders最新の HTTP レスポンスの UnityWebRequest によって受信されたすべてのレスポンスヘッダーを含むディクショナリを取得します。
SendWebRequestリモートサーバーとの通信を開始します。
SetRequestHeaderHTTP リクエストヘッダーをカスタムの値にセットします。

Static 関数

ClearCookieCacheClears stored cookies from the cache.
DeleteHTTP DELETE のために設定した UnityWebRequest を作成します。
EscapeURL文字列の文字をエスケープし、URL に親和性があることを保証します。
GenerateBoundaryマルチパートフォームバウンダリーとして使うためのランダムな 40 バイトの配列を生成します。
GetCreate a UnityWebRequest for HTTP GET.
HeadHTTP HEAD リクエストを送信するように設定された UnityWebRequest を作成します。
PostCreates a UnityWebRequest configured to send form data to a server via HTTP POST.
PutCreates a UnityWebRequest configured to upload raw data to a remote server via HTTP PUT.
SerializeFormSectionsIMultipartFormSection オブジェクトのリストを RAW マルチパートフォームデータを含むバイト配列に変換します。
SerializeSimpleFormURL エンコードされた UTF-8 のキャラクタを含むバイト配列にストリングのディクショナリをシリアライズします。
UnEscapeURLエスケープシーケンス(特殊文字)を変換し、ユーザーが使いやすいテキストを返します。