diff --git a/Runtime/Reporters/Slack/SlackAPI.cs b/Runtime/Reporters/Slack/SlackAPI.cs index 8407c4e..c2be8a2 100644 --- a/Runtime/Reporters/Slack/SlackAPI.cs +++ b/Runtime/Reporters/Slack/SlackAPI.cs @@ -166,8 +166,14 @@ private static async UniTask Post(string url, WWWForm form) private static async UniTask Post(string url, string token, Payload payload) { +#if UNITY_2022_2_OR_NEWER using (var www = UnityWebRequest.Post(url, payload.ToJson(), "application/json; charset=utf-8")) { +#else + using (var www = UnityWebRequest.Post(url, payload.ToJson())) + { + www.SetRequestHeader("Content-Type", "application/json; charset=utf-8"); +#endif www.SetRequestHeader("Authorization", $"Bearer {token}"); await www.SendWebRequest();