tangdj/http

http client library

Maintainers

Package info

github.com/tangdongjie/http

pkg:composer/tangdj/http

Statistics

Installs: 9

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.3 2021-08-09 04:44 UTC

This package is auto-updated.

Last update: 2026-04-09 14:37:03 UTC


README

This is a private warehouse service, feel free to use, problems need to be resolved

Test code

require_once './vendor/autoload.php';

use Tangdj\Http\TangdjHttp;

//异步
//$r = TangdjHttp::asJson()->get('127.0.0.1/esTest.php', ['a' => 'b'])->json();
//
//$r = TangdjHttp::asJson()->post('127.0.0.1/esTest.php', ['a' => 'b'])->json();

//并发
$r = TangdjHttp::unwrap([
    'a' => TangdjHttp::asJson()->getConcurrent('127.0.0.1/test.php', ['get_params' => ['a'=>111,'b'=>22]]),
    'b' => TangdjHttp::asJson()->postConcurrent('127.0.0.1/test.php', ['post_params' => ['c'=>333,'d'=>44]])
]);

$a = $r['a']->json();
$b = $r['b']->json();

var_dump($a);
var_dump($b);