0

I am using curl to download a file from an online web page but it gives this error:

curl: (6) Could not resolve host: jsonplaceholder.typicode.com.

However, it works fine when I run on localhost xampp.

theduck
  • 2,589
  • 13
  • 17
  • 23
ortan
  • 13
  • 5
  • Does this answer your question? [curl: (6) Could not resolve host: application](https://stackoverflow.com/questions/36361572/curl-6-could-not-resolve-host-application) – Raghavendra Jan 06 '20 at 11:13

1 Answers1

0

Actually it works:

curl -I jsonplaceholder.typicode.com
HTTP/1.1 200 OK

Moreover:

curl https://jsonplaceholder.typicode.com/todos/1 -s -o /tmp/x.json && cat /tmp/x.json
{
  "userId": 1,
  "id": 1,
  "title": "delectus aut autem",
  "completed": false
}
cn007b
  • 16,596
  • 7
  • 59
  • 74