So, I was following the article for appgyver backendless integration, and I ran into an issue running the test for the login integration.
I get a 400 error: Error: JSON error response from server: {“code”:17000,“message”:“JSON parse error: ‘Wrong JSON or ContentType.’.”,“errorData”:{}}.status: 400
I believe I have the schema as presented in the article:
, so I’m not sure what’s going on.
What does the schema look like?
Our instructions have the following screen. Could you show what it looks like in your appgyver setup?
Does appgyver give you a way to see the actual request body? Based on the error, it looks like the request body was not composed correctly. Seeing what it is would be very helpful.
Perfect! Could you please right-click here (see below) and choose “Copy > Copy as cURL” and share the cUIRL request with me?
Regards,
Mark
curl ‘https://api.backendless.com/359DA698-6644-7917-FFDA-DEA480EB9C00/61083E8E-BFBA-4241-9200-5456C6DF1833/users/login’
-H ‘Accept: /’
-H ‘Accept-Language: en-US,en;q=0.9’
-H ‘Connection: keep-alive’
-H ‘Content-Type: application/json header’
-H ‘Origin: https://platform.appgyver.com’
-H ‘Referer: https://platform.appgyver.com/’
-H ‘Sec-Fetch-Dest: empty’
-H ‘Sec-Fetch-Mode: cors’
-H ‘Sec-Fetch-Site: cross-site’
-H ‘User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36’
-H ‘sec-ch-ua: “.Not/A)Brand”;v=“99”, “Google Chrome”;v=“103”, “Chromium”;v=“103”’
-H ‘sec-ch-ua-mobile: ?0’
-H ‘sec-ch-ua-platform: “macOS”’
–data-raw ‘{“login":"test@test.com”,“password”:“111”}’
–compressed
Now we got to the bottom of this. Take a look at the following request header:
-H ‘Content-Type: application/json header’
The value for the Content-Type
header is incorrect with the extra word header
in it. What the value of the header should be is this:
application/json
Regards,
Mark