I wrote a REST plugin for posting data to my Drupal site, When I send JSON data from browser it is returning the error {readyState: 4, responseText: "{"error":"Syntax error"}", responseJSON: Object, status: 400, statusText: "Bad Request"}
but it is working fine in Postman. What might be the issue?
The data I am send is {"name" : "user", "pass" : "userpass"}
I am also adding the following headers in request.
"Content-Type", 'application/json'
"Accept", 'application/json'
'content-type', 'application/hal+json'
andAccept
is not necessary – No Sssweat Aug 22 '16 at 5:46