Php/laravel/laravel5/guzzle
提供: 初心者エンジニアの簡易メモ
guzzleとは
httpリクエスト用ライブラリ
guzzleインストール
composer require guzzlehttp/guzzle
確認
vi composer.json
"require": {
"guzzlehttp/guzzle": "^6.2"
}
サンプル
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Client;
$client = new Client(); //GuzzleHttp\Client
$result = $client->post('your-request-uri', [
'form_params' => [
'sample-form-data' => 'value'
]
]);
参考
https://medium.com/laravel-5-the-right-way/using-guzzlehttp-with-laravel-1dbea1f633da
