Issue
Getting url: (6) Could not resolve host: application error after this command :
curl -i -H 'Content-Type: application/json' -d '{"Code":"FR","Name":"France"}' http://127.0.0.1:8080/countries
Full error log:
curl: (6) Could not resolve host: application
HTTP/1.1 415 Unsupported Media Type
Content-Type: application/json; charset=utf-8
X-Powered-By: go-json-rest
Date: Sat, 02 Apr 2016 05:31:20 GMT
Content-Length: 73
{
"Error": "Bad Content-Type or charset, expected 'application/json'"
}
What's wrong with this command?
Edit:
I solved my problem editing like this in windows : "{/"Code/":/"FR/"}"
Solution
In my case, putting space after colon was wrong.
# Not work
curl -H Content-Type: application/json ~
# OK
curl -H Content-Type:application/json ~
Answered By - kujiy Answer Checked By - David Goodson (WPSolving Volunteer)