Curl

Send http request.

Installation

composer require mediashare/kernel
1

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);
1
2
3
4
5
6
7
8
9
10

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);
1
2
3
4
5
6
7
8
9
10
11
12
Last Updated: 1/13/2020, 6:01:34 PM