as far as I can tell from the documentation and testing, there is no mechanism for specifying a timeout for a UnityWebRequest, and that functionality needs to be provided by the developer in some sort of wrapper.
specifically, there’s no mention of timeout in any UWR constructors,
nor in any response/status codes.
the example code below returns after 10 seconds,
because it’s waiting for the server to respond.
i’m a fan of letting a request take as long as it wants,
but i’d also prefer not to implement timeout myself.
private IEnumerator crSlowRequest() {
string url = "http://httpbin.org/delay/10";
Debug.Log("requesting " + url + "....");
UnityEngine.Networking.UnityWebRequest uwr = UnityEngine.Networking.UnityWebRequest.Get(url);
float t1 = Time.realtimeSinceStartup;
yield return uwr.Send();
float t2 = Time.realtimeSinceStartup;
Debug.Log("request seconds: " + (t2 - t1) + " isError: " + uwr.isError + " error: " + uwr.error + " responseCode: " + uwr.responseCode + " responseContent: " + uwr.downloadHandler.text);
}