我想要实现的目标:
\n向 API 端点发出请求,检索 XML 并随后解析结果。
\n我正在发送一个file_get_contents请求来实现此目的。
问题:
\n\n`file_get_Contents` fails, error: \n\nWarning: file_get_contents(https://api.twitter.com/1.1/statuses/mentions_timeline.json):\nfailed to open stream: \n A connection attempt failed because the connected party did not properly \nrespond after a period of time, or established connection failed because \nconnected host has failed to respond. \nRun Code Online (Sandbox Code Playgroud)\n\n更新 17/08
\n\n为了巩固我目前的理解:
\n 1. PHP 失败:
\n1.a 它通过 php (超时)失败
\n1.b 它通过命令行失败(curl -G http://api.eve-central.com/api /quicklook?typeid=34 )
\n1.c file_get_contents
\n1.d file_get_contents w/ create_stream_context
2. 有效方法:
\n2.a 通过 …