https://github.com/phore/phore-http-client
Http client library
https://github.com/phore/phore-http-client
Last synced: 5 months ago
JSON representation
Http client library
- Host: GitHub
- URL: https://github.com/phore/phore-http-client
- Owner: phore
- Created: 2018-08-01T16:26:34.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-09-29T13:31:40.000Z (over 1 year ago)
- Last Synced: 2025-11-16T00:19:50.960Z (7 months ago)
- Language: PHP
- Homepage: https://infracamp.org/project/phore/
- Size: 123 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Phore http-client
[](https://github.com/phore/phore-http-client/actions)
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: