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/"}"
Mostly, such an error occurs when there is an issue with a Linux server's DNS resolver. A Linux administrator will categorize/define this challenge as a server management service issue.
Hi, cURL error 6. The error indicates that the network that UpdraftPlus is attempting to connect to is unreachable. This shows that the connection isn't being blocked, but is failing to reach the UpdraftPlus.com servers.
This error means that the hostname you are trying to connect to cannot be resolved to an IP address. (Hostnames are resolved to IP addresses by a DNS (Domain NameServer)). Please check what you have entered in the Address field. You will need the valid hostname of an FTP server or a valid IP address.
Solution: Please make sure you have an active Internet connection and your Kali DNS settings are correct. We recommend using Google public DNS servers. Please set both DNS servers to 8.8.
In my case, putting space after colon was wrong.
# Not work curl -H Content-Type: application/json ~ # OK curl -H Content-Type:application/json ~
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With