Skip to content

Commit

Permalink
com.utilities.rest 3.2.1 (#83)
Browse files Browse the repository at this point in the history
- Support multiple form fields with the same name

---------

Co-authored-by: Stephen Hodgson <[email protected]>
  • Loading branch information
Vedal987 and StephenHodgson authored Jul 11, 2024
1 parent 1f13392 commit 391d6d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Runtime/Rest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ UnityWebRequest.kHttpVerbPUT or
{
var boundary = contentType.Split(';')[1].Split('=')[1];
var formData = encodedData.Split(new[] { $"\r\n--{boundary}\r\n", $"\r\n--{boundary}--\r\n" }, StringSplitOptions.RemoveEmptyEntries);
var formParts = new Dictionary<string, string>();
var formParts = new List<Tuple<string, string>>();

foreach (var form in formData)
{
Expand All @@ -1207,12 +1207,12 @@ UnityWebRequest.kHttpVerbPUT or
{
const string filename = "filename=\"";
var fileName = fieldHeader.Split(new[] { filename }, StringSplitOptions.RemoveEmptyEntries)[1].Split('"')[0];
formParts.Add(key, fileName);
formParts.Add(new Tuple<string, string>(key, fileName));
}
else
{
var value = formFields[1];
formParts.Add(key, value);
formParts.Add(new Tuple<string, string>(key, value));
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Utilities.Rest",
"description": "This package contains useful RESTful utilities for the Unity Game Engine.",
"keywords": [],
"version": "3.2.0",
"version": "3.2.1",
"unity": "2021.3",
"documentationUrl": "https://github.com/RageAgainstThePixel/com.utilities.rest#documentation",
"changelogUrl": "https://github.com/RageAgainstThePixel/com.utilities.rest/releases",
Expand Down

0 comments on commit 391d6d6

Please sign in to comment.