Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.utilities.rest 2.5.4 #70

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
com.utilities.rest 2.5.4
- Fixed parsing json in request and body responses
  • Loading branch information
StephenHodgson committed Feb 29, 2024
commit 451d27e282af9a3dfecdf660bf6d018095716d49
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public abstract class BaseEndPoint<TClient, TAuthentication, TSettings>
/// <summary>
/// <see cref="IClient"/> for this endpoint.
/// </summary>
/// ReSharper disable once InconsistentNaming
protected readonly TClient client;

/// <summary>
Expand All @@ -39,7 +40,7 @@ public abstract class BaseEndPoint<TClient, TAuthentication, TSettings>
/// </summary>
/// <param name="endpoint">The endpoint url.</param>
/// <param name="queryParameters">Optional, parameters to add to the endpoint.</param>
protected string GetUrl(string endpoint = "", Dictionary<string, string> queryParameters = null)
protected virtual string GetUrl(string endpoint = "", Dictionary<string, string> queryParameters = null)
{
var result = string.Format(client.Settings.BaseRequestUrlFormat, $"{Root}{endpoint}");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public string ToString(string methodName)
{
try
{
debugMessageObject["request"]["body"] = JObject.Parse(RequestBody);
debugMessageObject["request"]["body"] = JToken.Parse(RequestBody);
}
catch
{
Expand All @@ -144,7 +144,7 @@ public string ToString(string methodName)

debugMessageObject["response"] = new()
{
["code"] = Code,
["code"] = Code
};

if (Headers != null)
Expand All @@ -171,7 +171,7 @@ public string ToString(string methodName)

try
{
((JArray)debugMessageObject["response"]["body"]).Add(JObject.Parse(part));
((JArray)debugMessageObject["response"]["body"]).Add(JToken.Parse(part));
}
catch
{
Expand All @@ -183,7 +183,7 @@ public string ToString(string methodName)
{
try
{
debugMessageObject["response"]["body"] = JObject.Parse(Body);
debugMessageObject["response"]["body"] = JToken.Parse(Body);
}
catch
{
Expand Down
2 changes: 1 addition & 1 deletion Utilities.Rest/Packages/com.utilities.rest/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": "2.5.3",
"version": "2.5.4",
"unity": "2021.3",
"documentationUrl": "https://github.com/RageAgainstThePixel/com.utilities.rest#documentation",
"changelogUrl": "https://github.com/RageAgainstThePixel/com.utilities.rest/releases",
Expand Down