美文网首页
php CURL的用法 简单的小例子

php CURL的用法 简单的小例子

作者: Robinbing | 来源:发表于2017-08-25 17:34 被阅读0次

$url="http://test.com:8001/service/RiskFormService/MO/view";

$post_data= array('headMsg'=>array("version"=> '0.1'),

"customerCode"=> 'test001',

"projectCode"=>'Test',

"moCode"=> $moCode);

$ch=curl_init();

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

// post数据

curl_setopt($ch, CURLOPT_POST,1);

//            // post的变量

@curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);

$output=curl_exec($ch);

curl_close($ch);

$content=$output;

print_r($content);

相关文章

  • php CURL的用法 简单的小例子

    $url="http://test.com:8001/service/RiskFormService/MO/vie...

  • curl 命令

    命令:curl 例子: 1、基本用法 # curl http://www.linux.com 执行后,www.li...

  • curl的简单用法

    获取网页 curl "www.baidu.com" 保存网页 -o 指定保存的网页名-O 根据网页自动设置保存的文...

  • 抓取淘宝数据实例

    简单demo curl.php是封装的一个curl请求的一个函数 model.php是数据库的读写操作 list....

  • mysql:case-when-end例子

    下面是简单的用法: 例子:

  • php curl常用用法

    一个简单的例子 先简单说一下语法, $ch=curl_init() 创建了一个curl会话,成功返回一个句柄。 c...

  • php curl经典最常用例子

  • http基础

    前言 今天调试的时候用到了curl,所以这周就简单介绍一下curl的用法。curl一般用来发送http请求,进行w...

  • curl发get、post请求

    环境配置 使用curl需要php.ini开启curl扩展、开启curl扩展的步骤如下 #vim /etc/php....

  • php-创建简单的curl

    一,创建一个post的curl 注意: 1,get和post基本一致至少是参数相对应的变化,post请求默认是按照...

网友评论

      本文标题:php CURL的用法 简单的小例子

      本文链接:https://www.haomeiwen.com/subject/btqpdxtx.html