cURL - 解决问题

时间:2016-07-25 09:20:37

标签: linux unix curl

我正在尝试发出解析为特定IP的cURL请求。从我读过的所有内容来看,这在语法上对我来说是正确的,但我仍然看到'无法解决主机错误'。有人能指出我正确的方向吗?我看到了各种各样的错误:

curl —-resolve e-dinar.io:443:42.81.15.75 "https://e-dinar.io"
IDN support not present, can't parse Unicode domains
* getaddrinfo(3) failed for —-resolve:80

curl —-resolve e-dinar.io:443:42.81.15.75 "https://e-dinar.io:443"
curl: (6) Couldn't resolve host '—-resolve'
curl: (6) Couldn't resolve host 'e-dinar.io:443'

curl "https://e-dinar.io:443" —-resolve e-dinar.io:443:42.81.15.75 
curl: (6) Couldn't resolve host '—-resolve'
curl: (6) Couldn't resolve host 'e-dinar.io:443'

我想出错的任何想法?感谢。

1 个答案:

答案 0 :(得分:1)

您在curl命令(-)中使用了错误的,将—-更改为--。 您在curl响应中有提示:

curl: (6) Couldn't resolve host '—-resolve'

curl尝试从—-resolve主机获取数据,由于-错误,它不会将其解析为命令。