【发布时间】:2014-08-29 08:21:05
【问题描述】:
drupal_http_request 在 url 中有空格时发送“Your client has issued a malformed or illegal request”:
$uri = "https://www.googleapis.com/freebase/v1/search?query=&prefixed=true&limit=10&output=(type )&lang=en";
$options = array(
'method' => 'GET',
'timeout' => 3,
'headers' => array(
'Accept' => 'application/json',
),
);
$result = drupal_http_request($uri, $options);
" &output=(type) " type 后面有空格。如果我删除空间,那么它工作正常。但空间给出 400 bad request 错误。为什么?
【问题讨论】:
标签: php http drupal httprequest freebase