joinww/httpclient

There is no license information available for the latest version (0.0.1) of this package.

httpclient components for get/post/put/delete request

0.0.1 2016-10-19 01:59 UTC

This package is not auto-updated.

Last update: 2025-06-11 23:56:41 UTC


README

HttpClient is a sample components for connect url

How to use

require_once 'path/vendor/autoload.php';
$httpClient = new HttpClient\Client();
$url = 'https://www.baidu.com/s?wd=php';
$response = $httpClient->get($url);
var_dump($response->getBody());
$url = 'http://127.0.0.1/tests/post.php';
$params = ['wd'='php'];
$cookies = ['st'=>1,'ad'=>1];
$response = $httpClient->post($url,$params,$cookies);
var_dump($response->getBody());