Skip to content

Commit 6be813a

Browse files
committed
Fix issue with the default content type as JSON
1 parent 4747a0c commit 6be813a

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

src/Proyecto26.RestClient/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
1818
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
1919

20-
[assembly: AssemblyVersion ("2.5.3")]
20+
[assembly: AssemblyVersion ("2.5.4")]
2121

2222
// The following attributes are used to specify the signing key for the assembly,
2323
// if desired. See the Mono documentation for more information about signing.

src/Proyecto26.RestClient/Proyecto26.RestClient.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata>
44
<id>Proyecto26.RestClient</id>
5-
<version>2.5.3</version>
5+
<version>2.5.4</version>
66
<title>RestClient for Unity</title>
77
<authors>Juan David Nicholls Cardona</authors>
88
<owners>jdnichollsc</owners>

src/Proyecto26.RestClient/RestClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Proyecto26
99
{
1010
/// <summary>
1111
/// RestClient for Unity
12-
/// Version: 2.5.3
12+
/// Version: 2.5.4
1313
/// </summary>
1414
public static partial class RestClient
1515
{

src/Proyecto26.RestClient/Utils/HttpBase.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,11 @@ public static IEnumerator DefaultUnityWebRequest<TResponse>(RequestHelper option
115115
public static IEnumerator SendWebRequest(UnityWebRequest request, RequestHelper options)
116116
{
117117
byte[] bodyRaw = options.BodyRaw;
118-
string contentType = CONTENT_TYPE_JSON;
119-
options.Headers.TryGetValue(CONTENT_TYPE_HEADER, out contentType);
118+
string contentType = string.Empty;
119+
if (!options.Headers.TryGetValue(CONTENT_TYPE_HEADER, out contentType))
120+
{
121+
contentType = CONTENT_TYPE_JSON;
122+
}
120123
if (options.Body != null || !string.IsNullOrEmpty(options.BodyString))
121124
{
122125
var bodyString = options.BodyString;

0 commit comments

Comments
 (0)