I am trying to send an image over to the server via Unity. I am able to achieve sending image via command prompt with the below code:
curl -H "Authorization: Token 555myToken555" -F "id=Image01" -F "image=@/home/example.png" https://mywebsite.com
But the same way I cannot achieve using Unity’s Web Request. Where do I provide the “id=Image01” and http link? Also is Put() better in performance than Post()?
public Texture2D tex;
UnityWebRequest unityWebRequest= UnityWebRequest.Put( tex, texture.EncodeToPNG());
unityWebRequest.SetRequestHeader("Authorization", "Token 555myToken555");
unityWebRequest.SendWebRequest();