Python Forum

Full Version: 500 error cannot deserialize json object
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Unable to resolve this error while calling API endpoint in flask. Passing the data as json in the POST request. Could someone hep me with the way to resolve this error.

[500 b'Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Guid[]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.\r\nTo fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.\r\nPath 'id', line 1, position 6.' ]
My code
[def sync_user_direct(self):
            self.port = 4240
            path = 'qrs/usersdirconnect/syncuserdirect'
            body = {"id": "fba0485e-2f45-4a2f-951c-ef257f469ba8"}
            print(, data=json.dumps(body)))
            return json.loads(, data=json.dumps(body)).decode('utf-8'))]