Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


HttpForcedVersion

Force the version of HTTP used when making web requests with UnityHttpMessageHandler.
Read time 1 minuteLast updated 6 days ago

Definition

public HttpForcedVersion HttpForcedVersion { get; set; }

Remarks

Setting this property to
HttpForcedVersion.NotForced
causes UnityHttpMessageHandler to use standard negotiation with the server to determine the HTTP version to use.
Using other values causes UnityHttpMessageHandler to force the web requests to a particular version of HTTP even if insecure HTTP is being used.
Default value:
HttpForcedVersion.NotForced
.
Demonstrating how to force web requests to HTTP/2 using
UnityHttpMessageHandler
.

Examples

using UnityEngine.Networking;public class HttpForcedVersionExample{ public static UnityEngine.Networking.UnityHttpMessageHandler MakeHttpHandlerWithForcedHttp2() { var httpHandler = new UnityEngine.Networking.UnityHttpMessageHandler() { HttpForcedVersion = HttpForcedVersion.HTTP2 }; return httpHandler; }}