Curl

Send http request.

Installation

composer require mediashare/kernel

Methods

Get request

<?php
require 'vendor/autoload.php';
use Mediashare\Kernel\Kernel;

$kernel = new Kernel();
$kernel->run();

$curl = $kernel->get('Curl');
$result = $curl->get('https://postman-echo.com/get?foo=bar');
var_dump($result);

Post request

<?php
require 'vendor/autoload.php';
use Mediashare\Kernel\Kernel;

$kernel = new Kernel();
$kernel->run();

$curl = $kernel->get('Curl');
$result = $curl->post('https://postman-echo.com/post', [
    'foo' => 'bar'
]);
var_dump($result);

MarquandT

Ethical Hacker ~ Web Developper ~ Hosting Provider ~ Crypto Enthusiast ~ Automation Expert Bitcoin donation: 32Uu4NKGnxSPC7UukYXVyRHwbppbQpKVki

Comments

You must login to send a comment.