错误获取请求PHP

时间:2015-11-24 07:05:51

标签: php api

我必须向远程服务器发送GET请求以使用PHP获取一些JSON数据。 但我得到警告窗口错误:

 Failed to load resource: the server responded with a status of 404 (Not Found)

    http://duty.megafon.tj/VAADIN/vaadinBootstrap.js?v=7.4.3 
Failed to load resource: the server responded with a status of 404 (Not Found)

    l.php:22 Uncaught ReferenceError: vaadin is not defined

这是我的PHP代码:

@curl_setopt($ch, CURLOPT_URL, 'http://example.com/&clientId=m&clientSecret=m');
@curl_setopt($ch, CURLOPT_HEADER, false);
@curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
@curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,30);
@curl_setopt($ch,CURLOPT_USERAGENT,'(http://example.com/&clientId=m&clientSecret=m)');
$date = curl_exec($ch);
echo($date);
@curl_close($ch);

1 个答案:

答案 0 :(得分:0)

尝试将您的PHP代码更改为:

def index
  @table = Table.new
end