Another Alternative for the command line that is easier than fighting with quotation marks is to put the json into a file, and use the @ prefix of curl parameters, e.g. with the following in json.txt:
{ "syncheader" : {
"servertimesync" : "20131126121749",
"deviceid" : "testDevice"
}
}
then in my case I issue:
curl localhost:9000/sync -H "Content-type:application/json" -X POST -d @json.txt
Keeps the json more readable too.