Download the PHP package axguowen/http-client without Composer
On this page you can find all versions of the php package axguowen/http-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download axguowen/http-client
More information about axguowen/http-client
Files in axguowen/http-client
Download axguowen/http-client
More information about axguowen/http-client
Files in axguowen/http-client
Vendor axguowen
Package http-client
Short Description Simple HTTP Client Library for PHP
License Apache-2.0
Package http-client
Short Description Simple HTTP Client Library for PHP
License Apache-2.0
Please rate this library. Is it a good library?
Informations about the package http-client
PHP HTTP客户端
一个简单的HTTP客户端工具
主要功能:
发送请求
安装
composer require axguowen/http-client
用法示例
发送get请求
// 请求url
$url = 'https://domain/path/';
// header参数
$headers = [
'Content-Type' => 'application/json;charset=utf-8'
];
// 发送请求
$ret = \axguowen\HttpClient::post($url, $headers);
if (!$ret->ok()) {
return [null, new \axguowen\httpclient\Error($path, $ret)];
}
$r = ($ret->body === null) ? [] : $ret->json();
发送post请求
// 请求url
$url = 'https://domain/path/';
// 请求体
$body = [
'id' => 1,
'page' => 2,
];
// header参数
$headers = [
'Content-Type' => 'application/json;charset=utf-8'
];
// 发送请求
$ret = \axguowen\HttpClient::post($url, $body, $headers);
if (!$ret->ok()) {
return [null, new \axguowen\httpclient\Error($path, $ret)];
}
$r = ($ret->body === null) ? [] : $ret->json();
All versions of http-client with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.6.0
ext-curl Version *
ext-curl Version *
The package axguowen/http-client contains the following files
Loading the files please wait ...