通过php发布Curl请求
我想向pilosa数据库发送一个post请求。请求是这样的- curl localhost:10101/index/user/query -X柱 -d“位图(frame=“language”,id=5)” 如何通过php发送以下请求 参考链接:如果您没有可用的库,可以使用php的通过php发布Curl请求,php,curl,post,Php,Curl,Post,我想向pilosa数据库发送一个post请求。请求是这样的- curl localhost:10101/index/user/query -X柱 -d“位图(frame=“language”,id=5)” 如何通过php发送以下请求 参考链接:如果您没有可用的库,可以使用php的文件\u get\u contents查询Pilosa,该文件是核心php的一部分。以下php脚本应执行示例查询: <?php $url = 'http://localhost:10101/index/user/
文件\u get\u contents
查询Pilosa,该文件是核心php的一部分。以下php脚本应执行示例查询:
<?php
$url = 'http://localhost:10101/index/user/query';
$data = 'Bitmap(frame="language", id=5)';
$options = array(
'http' => array(
'method' => 'POST',
'content' => $data
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
var_dump($result);
?>
“如何通过php发送以下请求?”-阅读cURL命令行文档,了解参数的含义。然后阅读PHP cURL文档,找出相应的选项/调用。对于接下来的问题,请转到并阅读,然后,如果您确定您的问题符合SO规则,请阅读,以便能够提出一个好的、格式良好的主题问题。