Skip to content

fix(rest-connector): allow sending formdata on put request#43

Merged
kevinkowa merged 1 commit intomainfrom
fix-put
Jun 10, 2021
Merged

fix(rest-connector): allow sending formdata on put request#43
kevinkowa merged 1 commit intomainfrom
fix-put

Conversation

@kevinkowa
Copy link
Copy Markdown
Contributor

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.

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.
if (req.HttpMethod == UnityWebRequest.kHttpVerbPUT)
{
unityWebRequest.method = "PUT";
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a bit inconsistent btw post and put

does this work?

if (req.HttpMethod == UnityWebRequest.kHttpVerbPOST)
{
    unityWebRequest = UnityWebRequest.Post(url, form);
}
if (req.HttpMethod == UnityWebRequest.kHttpVerbPUT)
{
    unityWebRequest = UnityWebRequest.Put(url, form);
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mediumTaj Put doesn't allow formdata in the second parameter

@kevinkowa kevinkowa requested a review from padamstx June 10, 2021 14:41
Copy link
Copy Markdown

@padamstx padamstx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kevinkowa kevinkowa merged commit c383571 into main Jun 10, 2021
@kevinkowa kevinkowa deleted the fix-put branch June 10, 2021 16:31
@mediumTaj
Copy link
Copy Markdown
Member

🎉 This PR is included in version 1.2.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants