phore / http-client
Http client library for fast api access
v1.0.9
2024-01-30 11:20 UTC
Requires
- php: >=7.1
- ext-curl: *
- ext-json: *
- phore/core: *
Requires (Dev)
Suggests
- phore/cache: Use request caching
This package is auto-updated.
Last update: 2026-06-11 10:58:22 UTC
README
Easy to use http-client with fluent api.
Example
$response = phore_http_request("http://localhost/test.php?case=200") ->send(); echo $response->getBody();
More executable examples are available in examples/.
Request caching
Request Caching requires phore/cache package to be installed
$cache = new Cache(new ObjectStore(new FileSystemObjectStoreDriver("/tmp/cache1")));
$req = phore_http_request("http://localhost/")->withCache($cache)->send();
if ($req->isFromCache() === true)
echo "From Cache: " . $req->getBody();
Examples: see examples/ and examples/README.md.