ryodevz/httpfulwrapper

httpful库的包装类,使其使用更便捷。

v2.0.0 2021-08-31 16:43 UTC

This package is auto-updated.

Last update: 2024-09-29 05:56:26 UTC


README

Latest Version Total Downloads

特性

GET 请求 POST 请求 PUT 请求

安装 Httpfulwrapper

推荐通过 Composer 安装 httpfulwrapper。

composer require ryodevz/httpfulwrapper

GET

use Ryodevz\HttpfulWrapper\Http;

require_once 'vendor/autoload.php';

// Make a request
$request = Http::get('https://ytryo.my.id/api/animeku/search?q=naruto');

// Send
$response = $request->send();

// Body
var_dump($response->body);

POST

use Ryodevz\HttpfulWrapper\Http;
use Ryodevz\HttpfulWrapper\Mime;

require_once 'vendor/autoload.php';

$response = Http::post('https://example.com/login', [
    'email' => 'zulzariozairi@gmail.com',
    'password' => 'secret'
], Mime::FORM)->send();

var_dump($response->body);

Mimes