我在 URL 上使用 Zend HTTP 时遇到问题:
$client = new Zend_Http_Client('http://xxfire_killumiex.api.channel.livestream.com/2.0/info.json');
$feed = $client->request()->getBody();
出于某种原因,这给了我一个错误......
Invalid URI supplied
这个特定的网址有什么问题?
我在 URL 上使用 Zend HTTP 时遇到问题:
$client = new Zend_Http_Client('http://xxfire_killumiex.api.channel.livestream.com/2.0/info.json');
$feed = $client->request()->getBody();
出于某种原因,这给了我一个错误......
Invalid URI supplied
这个特定的网址有什么问题?
这个特定的网址有什么问题?
下划线。
来自 RFC 1912
主机名标签中允许的字符只有 ASCII 字母、数字和“-”字符。
编辑
在做了一些阅读之后,似乎 Zend 在这种情况下可能是错误的。
根据ZF-9671,您可能不走运,尽管我已经重新打开了这个问题。
同时我的建议;像这样创建自己的 HTTP 客户端类
class My_Http_Client extends Zend_Http_Client
{
public function validateHost($host = null)
{
if ($host === null) {
$host = $this->_host;
}
// If the host is empty, then it is considered invalid
if (strlen($host) === 0) {
return false;
}
return true;
}
}