I'm able to update a mobile worker using the API using CURL but only if I supply the json data in a file. I'm unable to pass the same data in-line in the CURL command. I'm getting {"error": "Request is not valid JSON."}
Any ideas what I'm doing wrong?
This works:
curl -u user@mydomain.com:password -X PUT https://www.commcarehq.org/a/my-project/api/v0.5/user/123456abcd12345/ -H "Content-Type: application/json" -d "@data.txt" -L
where data.txt contains the following:
{
"first_name": "John"
}
This does not work:
curl -u user@mydomain.com:password -X PUT https://www.commcarehq.org/a/my-project/api/v0.5/user/123456abcd12345/ -H "Content-Type: application/json" -d '{"first_name":"John"}' -L
I realise this may be Curl related, but I thought I'd ask anyhow in case anyone has any bright ideas.
Thanks!