и страницу яндекса ниже. а curl_multi_exec так этож ток пхп 5 (((( неужели задуманное мною невозможно осуществить на пхп4. задача вродеб не сложная. но решить её самостоятельно увы не могу(( ввиду отсутствия опыта работы с curl .
Getting url: (6) Could not resolve host: application error after this command :
Full error log:
What’s wrong with this command?
I solved my problem editing like this in windows : ""
5 Answers 5
In my case, putting space after colon was wrong.
It’s treating the string application as your URL. This means your shell isn’t parsing the command correctly. My guess is that you copied the string from somewhere, and that when you pasted it, you got some characters that looked like regular quotes, but weren’t. Try retyping the command; you’ll only get valid characters from your keyboard. I bet you’ll get a much different result from what looks like the same query. As this is probably a shell problem and not a ‘curl’ problem (you didn’t build cURL yourself from source, did you?), it might be good to mention whether you’re on Linux/Windows/etc.
Example for Slack. (use your own web address you generate there).
curl -X POST -H "Content-type:application/json" —data "<"text":"A New Program Has Just Been Posted. ">" https://hooks.slack.com/services/T7M0PFD42/BAA6NK48Y/123123123123123
I was getting this error too. I resolved it by installing: https://git-scm.com/
and running the command from the Git Bash window.
I replaced all the single quotes [‘] to double quotes ["] and then it worked perfectly. Thanks for the input by @LogicalKip.
I try to run cocurrent curl but it can easily report "Could not resolve host". To run curl parallel, I use "parallel".
How could resolve host fail for just 4 concurrent curl? I simulate this because the original problem I encounter is described in php curl localhost is slow when making concurrent requests. I really don’t think it’s an open file limit issue since there is just 4 concurrent curl. Can anyone explain why this occurs? By the way, the OS is ubuntu 16.04.