Download the PHP package pfinal/http without Composer
On this page you can find all versions of the php package pfinal/http. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Vendor pfinal
Package http
Short Description The PFinal Http package.
License MIT
Homepage http://www.pfinal.cn
Package http
Short Description The PFinal Http package.
License MIT
Homepage http://www.pfinal.cn
Please rate this library. Is it a good library?
Informations about the package http
Http
一个简单易用的PHP HTTP 客户端, 基于cURL封装
使用composer 安装
示例
<?php
require __DIR__ .'/vendor/autoload.php';
// 如果未使用composer,使用下面的方式加载类
// require __DIR__ . '/src/ClassLoader.php';
// \PFinal\Http\ClassLoader::register();
$client = new \PFinal\Http\Client();
$response = $client->get('http://www.baidu.com');
//http状态码 例如: 200 404 等
var_dump($response->getStatusCode());
var_dump($response->getTransferInfo());
echo '<br>';
//响应内容
$body = $response->getBody();
echo nl2br(htmlspecialchars($body));
// post
// $client->post($url,array('name'=>'Ethan','password'=>'123456'));
// file upload
// $client->file($url, 'photo', './images/1.jpg');
// download
// $response = $client->get('https://www.baidu.com/img/bd_logo1.png');
// if ($response->getStatusCode() == 200) {
// file_put_contents('./bd.png', $response->getBody());
// }
All versions of http with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.3
The package pfinal/http contains the following files
Loading the files please wait ....