parse-community / Parse-SDK-dotNET

Parse SDK for .NET, Xamarin, Unity.
http://parseplatform.org
Apache License 2.0
322 stars 260 forks source link

Error: ArgumentException: Input JSON was invalid. #365

Closed anhhtca closed 2 years ago

anhhtca commented 2 years ago

New Issue Checklist

Issue Description

ArgumentException: Input JSON was invalid.

Steps to reproduce

I used the examaple code:

// Instantiate a ParseClient.
ParseClient client = new ParseClient(/* Parameters */);

// Create a user, save it, and authenticate with it.
await client.SignUpAsync(username: "Test", password: "Test");

// Get the authenticated user. This is can also be done with a variable that stores the ParseUser instance before the SignUp overload that accepts a ParseUser is called.
Console.WriteLine(client.GetCurrentUser().SessionToken);

// Deauthenticate the user.
await client.LogOutAsync();

// Authenticate the user.
ParseUser user = await client.LogInAsync(username: "Test", password: "Test");

// Create a new object with permessions that allow only the user to modify it.
ParseObject testObject = new ParseObject("TestClass") { ACL = new ParseACL(user) };

// Bind the ParseObject to the target ParseClient instance. This is unnecessary if Publicize is called on the client.
testObject.Bind(client);

// Set some value on the object.
testObject.Set("someValue", "This is a value.");

// See that the ObjectId of an unsaved object is null;
Console.WriteLine(testObject.ObjectId);

// Save the object to the target Parse Server instance.
await testObject.SaveAsync();

// See that the ObjectId of a saved object is non-null;
Console.WriteLine(testObject.ObjectId);

Error at row await testObject.SaveAsync();

ArgumentException: Input JSON was invalid.

Parse.Infrastructure.Utilities.JsonUtilities.Parse(string input)
ParseFailureException: Invalid or alternatively-formatted response recieved from server.

Parse.Infrastructure.Execution.ParseCommandRunner+<>c__DisplayClass17_0.<RunCommandAsync>b__1(Task<Tuple<HttpStatusCode, string>> task)

Actual Outcome

Expected Outcome

Environment

Server

Database

Client

Logs

anhhtca commented 2 years ago

Just add the / at end of the Server URL => abc.com/parse/