httpForcedVersion
Force the version of HTTP used when making web requests with UnityWebRequest.
阅读时间1 分钟最后更新于 1 个月前
Definition
- Type: Property
- Namespace: UnityEngine.Networking
- Assembly: UnityEngine.UnityWebRequestModule
public HttpForcedVersion httpForcedVersion { get; set; }
Remarks
Setting this property to causes UnityWebRequest to use standard negotiation with the server to determine which HTTP version to use.
HttpForcedVersion.NotForcedUsing other values causes UnityWebRequest to force the web requests to a particular version of HTTP even if insecure HTTP is being used.
Default value: .
HttpForcedVersion.NotForcedRefer to HttpForcedVersion for more information.
Demonstrating how to force web requests to HTTP/2 using .
UnityWebRequestExamples
using UnityEngine.Networking;public class HttpForcedVersionExample{ public static UnityEngine.Networking.UnityWebRequest MakeUnityWebRequestWithForcedHttp2() { var httpHandler = new UnityEngine.Networking.UnityWebRequest() { httpForcedVersion = HttpForcedVersion.HTTP2 }; return httpHandler; }}