yadakhov/curl

A simple php curl wrapper class.

v1.1.0 2021-04-30 18:33 UTC

This package is auto-updated.

Last update: 2024-03-29 03:07:00 UTC


README

A simple curl wrapper class to perform GET and POST.

Installation

Install from packagist

composer require yadakhov/curl

Or add to your composer.json

    "require": {
        "yadakhov/laradump": "^1.0"
    },

The api interface.

public static getInstance();
public function get($url, array $params = []);
public function post($url, array $params = []);

Perform a GET request

$curl = new \Yadakhov\Curl;
$curl->get('http://example.com');

Perform a POST request

$response = Curl::getInstance()->post('http://example.com', ['id' => '1']);