phore / http-client
Http client library for fast api access
Installs: 8 133
Dependents: 12
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
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: 2024-11-29 14:01:16 UTC
README
Easy to use http-client with fluent api.
Example
phore_http_request("http://localhost/test.php?case=200")->withMethod()
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: