安裝套件
Composer require guzzlehttp/guzzle
使用方法
use GuzzleHttp\Client;
$client = new Client();
GET
$response_origin = $client->request('GET', url);
POST
1 | $response_origin = $client->request('POST', url, |
$response = json_decode($response_origin->getBody())
$data = $response->data