Curl模拟Http工具类
可实现模拟GET、POST、POST上传文件.
require 'HttpCurl.class.php';// GET请求HttpCurl::get('http://api.example.com/');// GET请求, 并json_decode返回的数组HttpCurl::get('http://api.example.com/?a=123&b=456', 'json');// POST请求HttpCurl::post('http://api.example.com/?a=123', array( 'abc'=>'123', 'efg'=>'567'));HttpCurl::post('http://api.example.com/', '这是post原始内容', 'json');// POST请求, 文件上传HttpCurl::post('http://api.example.com/', array( 'file1'=>'@/data/sky.jpg', 'file2'=>'@/data/bird.jpg',));
项目主页:http://www.open-open.com/lib/view/home/1439448225411
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号