Как отправить post-запрос с авторизацией?
Вот код (url и ключ верные, убраны из кода):
IEnumerator PostRequest()
{
string url = "";
string authKey = "";
WWWForm form = new WWWForm();
UnityWebRequest uwr = UnityWebRequest.Post(url, form);
uwr.SetRequestHeader("Authorization", authKey);
yield return uwr.SendWebRequest();
if (uwr.isNetworkError)
{
Debug.Log("Error While Sending: " + uwr.error);
}
else
{
Debug.Log("Received: " + uwr.downloadHandler.text);
}
}
Пишет:
Error While Sending: Cannot resolve destination host