Skip to content

Commit

Permalink
fix(rest-connector): allow sending formdata on put request
Browse files Browse the repository at this point in the history
this fixes an issue with NLU when trying to send a file through a put request. Otherwise, it would
change the put request to a post automatically.
  • Loading branch information
kevinkowa committed Jun 10, 2021
1 parent 47f512e commit c9a0932
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Connection/RESTConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,10 @@ private IEnumerator ProcessRequestQueue()
Log.Error("RESTConnector.ProcessRequestQueue()", "Exception when initializing WWWForm: {0}", e.ToString());
}
unityWebRequest = UnityWebRequest.Post(url, form);
if (req.HttpMethod == UnityWebRequest.kHttpVerbPUT)
{
unityWebRequest.method = "PUT";
}
}
else if (req.Send != null)
{
Expand Down

0 comments on commit c9a0932

Please # to comment.