CURL GET POST
来源:互联网 发布:淘宝客服模板大小 编辑:程序博客网 时间:2024/06/06 05:39
//初始化
$ch = curl_init();
$ch = curl_init();
//设置选项,包括URL
curl_setopt($ch, CURLOPT_URL, "http://www.jb51.net");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
//执行并获取HTML文档内容
$output = curl_exec($ch);
//释放curl句柄
curl_close($ch);
//打印获得的数据
print_r($output);
$url = "http://localhost/web_services.php";
$post_data = array ("username" => "bob","key" => "12345");
$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);
//打印获得的数据
print_r($output);
0 0
- curl post and get
- CURL模拟POST/GET
- cURL-GET/POST/上传
- CURL GET POST
- php curl (get post)
- curl 常用命令 post、get
- php curl post get
- curl get post请求
- Curl发送get/post
- curl post get封装
- curl get&post
- curl get post语句
- Curl get/post传值
- curl 模拟 get和post
- curl get post 请求数据
- curl get post 获取数据
- php curl post和get
- php curl get和post
- 聊聊并发(六)ConcurrentLinkedQueue的实现原理分析
- Android性能专项测试之Network monitor
- 五、智力题
- 黑马程序——抽象类和接口
- linux
- CURL GET POST
- POJ3278 Catch That Cow
- java中String s="abc"及String s=new String("abc")详解
- linux环境下修改环境变量的几点总结
- Map遍历的方法
- Android性能专项测试之GPU Monitor
- 迷宫算法以及图形化android显示
- 分享一个不错的mysql语句
- snmp 表对象 的自动编译