Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

curl: (6) Could not resolve host: application

Tags:

curl

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/"}"

like image 337
Yeahia2508 Avatar asked Apr 01 '16 16:04

Yeahia2508


People also ask

Could not resolve host cURL 6?

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.

What does cURL error 6 mean?

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.

Could not resolve host reason?

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.

Can't resolve host Kali Linux?

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.


1 Answers

In my case, putting space after colon was wrong.

# Not work curl -H Content-Type: application/json ~ # OK curl -H Content-Type:application/json ~ 
like image 139
kujiy Avatar answered Sep 30 '22 00:09

kujiy