There is no license information available for the latest version (dev-master) of this package.

Simplify http requests.

dev-master 2021-10-14 12:28 UTC

This package is auto-updated.

Last update: 2025-07-14 20:56:14 UTC


README

composer require ibuildwebapps/gobble:dev-master

Simplified curl wrapper. This was built as a much simpler alternative to Guzzle.

GET example:

        $uri = "https://www.google.com" ;
        $gobble = new Gobble($uri) ;
        //$gobble->setMethod('GET'); /* This is implied */
        $gobble->send() ;
        $body = $gobble->getResponseBody() ;
        $code = $gobble->getResponseCode() ;
        echo 'Response body: ' . $body . "\n";
        echo 'Response code: ' . $code . "\n";

POST example:

        $uri = "https://www.google.com" ;
        $gobble = new Gobble($uri) ;
        $gobble->setMethod('POST');
        $gobble->setData([$param => $value]);
        $gobble->send() ;
        $body = $gobble->getResponseBody() ;
        $code = $gobble->getResponseCode() ;
        echo 'Response body: ' . $body . "\n";
        echo 'Response code: ' . $code . "\n";