When sending JSON requests to the server, I\'m often greeted by this message:
The request sent by the client was syntactically incorrect ().
Old case, my be irrelevant by now, but for others with similar trouble I'll add this entry.
Check that you have double quotes, not single quotes. Also try escaping them.
I used the app curl for my test json requests.
My JSON was like this
{ 'name' : 'somedata', 'town':'some town' }
and it just blew up in my eyes.
"The request sent by the client was syntactically incorrect" was the general error. So I changed it from single quotes to double quotes, no go. I then tried having a backslash infront of the single quotes, still no go. Then changed it to backslash infront of the double quotes and presto!
curl -i -H "Accept: application/json" -H "Content-Type: application/json" \
http://localhost:8077/dra/dump.json \
-X PUT -d "{\"name\" : \"My Name\", \"town\":\"My Town\"}"