【发布时间】:2014-04-24 06:13:01
【问题描述】:
我正在开发 oxwall 插件。我被困在一个问题上。 我需要知道如何向 url 发送 http 请求。 例如:
1) 在 joomla CMS 中,我们发送这样的请求,
$http = new JHttp($options, $transport);
$response = $http->post($url, $data);
2)在drupal中,
$options = array(
'method' => 'POST',
'data' => $data,
'timeout' => 15,
'headers' => array('Content-Type' => 'application/json'),
);
$result = drupal_http_request($url, $option);
我想知道,oxwall 执行此任务的方式是什么,请帮助我或提示我要查看哪个库。如果我无法找到解决方案,可以使用自定义 php 代码发送请求。会不会影响插件的性能?
【问题讨论】:
-
是的,我可以使用 curl ,但必须有一些 oxwall 的方式来做到这一点。我的首要任务是使用 oxwall 的内置功能。如果找不到方法,我将使用自定义 php 代码。
-
也许这个 (stackoverflow.com/questions/21813776/…) 帖子会有所帮助
-
牛墙开发者有什么帮助吗?
标签: php http httprequest oxwall