funch/curl

a tiny php cURL client

1.1.0 2016-12-14 05:28 UTC

This package is not auto-updated.

Last update: 2024-04-13 17:52:00 UTC


README

#对Curl的简单封装

<?php

use Funch\Curl\CurlClient as Curl;

$baseUrl = 'http://www.foo.com/';

Curl::setBaseUrl($baseUrl);

$res = Curl::request([
    'url' => 'user/1',
    'headers' => [
        'X-FROM' => 'CurlClient'
    ],
    'cookies' => [
        'sid' => '1234567890'
    ]
]);

echo $res;