funch/curl

一个小巧的 PHP cURL 客户端

1.1.0 2016-12-14 05:28 UTC

This package is not auto-updated.

Last update: 2024-09-28 20:20:05 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;