https://github.com/markmybytes/php-simple-requester
A simple PHP cURL warpper
https://github.com/markmybytes/php-simple-requester
Last synced: 5 months ago
JSON representation
A simple PHP cURL warpper
- Host: GitHub
- URL: https://github.com/markmybytes/php-simple-requester
- Owner: markmybytes
- Created: 2022-10-10T12:34:17.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-03T08:23:23.000Z (almost 2 years ago)
- Last Synced: 2025-02-13T08:51:22.544Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# php-simple-requester
A simple PHP cURL warpper
## Usage
```php
// get request
$response = HTTPRequester::init("https://api.ipify.org")
->setQuery(['format' => "json"])
->get()
->jsonResponse();
// post request
$requester = HTTPRequester::init("https://post-to-this-site.com")
->setHeader(['Content-Type' => "application/json])
->setJsonPayload(['foo' => 'bar'])
->post();
$requester->jsonResponse();
$requester->url();
$requester->remoteIp();
```