UnityWebRequest provides a modular system for composing HTTP requests and handling HTTP responses. The primary goal of the UnityWebRequest system is to allow Unity games to interact with web browser back-ends. It also supports high-demand features such as chunked HTTP requests, streaming POST/PUT operations, and full control over HTTP headers and verbs.
The system consists of two layers:
To learn more about these layers, see the the following pages contained in this section:
The UnityWebRequest system supports most Unity platforms:
The UnityWebRequest ecosystem breaks down an HTTP transaction into three distinct operations:
To provide a better interface for advanced users, these operations are each governed by their own objects:
UploadHandlerobject handles transmission of data to the server
DownloadHandlerobject handles receipt, buffering and postprocessing of data received from the server
UnityWebRequestobject manages the other two objects, and also handles HTTP flow control. This object is where custom headers and URLs are defined, and where error and redirect information is stored.
For any HTTP transaction, the normal code flow is:
Send()call to wait for the request to complete
• 2017–05–16 Page amended with no editorial review
Did you find this page useful? Please give it a rating: