Skip to content

Commit

Permalink
docs: UnityWebRequest auto upgrade for UNITY_2022_3_OR_NEWER
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Frowen committed Dec 28, 2023
1 parent 39557cd commit a160ae8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Assets/Mirage/Samples~/Snippets/CustomAuthenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ private static async UniTask<ValidateResultJson> ValidateToken(string token)
var sendJson = JsonUtility.ToJson(new ValidateTokenJson { token = token });

// make sure to send token over https
#if UNITY_2022_3_OR_NEWER
var webRequest = UnityWebRequest.PostWwwForm("https://example.com/api/validate", sendJson);
#else
var webRequest = UnityWebRequest.Post("https://example.com/api/validate", sendJson);
#endif

// wait for result
var op = await webRequest.SendWebRequest();
Expand Down

0 comments on commit a160ae8

Please sign in to comment.