I have Dropwizard backend end and like to use curl to make a POST request with a Json body
I used Postman with the settings on the body tab raw
radio button selected and on the drop down menu JSON(applicattion/json)
.I entered the body and was able to successfully create a POST request.
However when I used curl I get an error. I used
curl -v -X POST "localhost:8080/resource"
-H "Content-Type: application/json"
-d '{label1: "words1", label2: "words2"}'
I get the error message
{"code":400,"message":"Unable to process JSON"}
From my understanding it is curl that has an issue since Postman was able to create the POST request.
This
{label1: "words1", label2: "words2"}
is not JSON. Use
{"label1": "words1", "label2": "words2"}