From 391d6d6eab6748f2ab60747663ef8dd14b449e5a Mon Sep 17 00:00:00 2001 From: Vedal <19514591+Vedal987@users.noreply.github.com> Date: Thu, 11 Jul 2024 21:06:32 +0100 Subject: [PATCH] com.utilities.rest 3.2.1 (#83) - Support multiple form fields with the same name --------- Co-authored-by: Stephen Hodgson --- Runtime/Rest.cs | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Runtime/Rest.cs b/Runtime/Rest.cs index 7d72924..4a1e798 100644 --- a/Runtime/Rest.cs +++ b/Runtime/Rest.cs @@ -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(); + var formParts = new List>(); foreach (var form in formData) { @@ -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(key, fileName)); } else { var value = formFields[1]; - formParts.Add(key, value); + formParts.Add(new Tuple(key, value)); } } diff --git a/package.json b/package.json index b7a41ce..12778a5 100644 --- a/package.json +++ b/package.json @@ -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",