yadakhov/curl

一个简单的PHP curl包装类。

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

This package is auto-updated.

Last update: 2024-08-29 04:01:16 UTC


README

一个用于执行GET和POST请求的简单curl包装类。

安装

packagist安装

composer require yadakhov/curl

或者在您的composer.json中添加

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

API接口。

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

执行GET请求

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

执行POST请求

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