Skip to content

Latest commit

 

History

History
21 lines (18 loc) · 477 Bytes

README.md

File metadata and controls

21 lines (18 loc) · 477 Bytes

php-simple-requester

A simple PHP cURL warpper

Usage

// 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();