「Php/laravel/laravel5/guzzle」の版間の差分
提供: 初心者エンジニアの簡易メモ
(ページの作成:「==guzzleとは== httpリクエスト用ライブラリ ==guzzleインストール== composer require guzzlehttp/guzzle ==確認== vi composer.json "require": {...」) |
|||
| 行10: | 行10: | ||
"guzzlehttp/guzzle": "^6.2" | "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' | ||
| + | ] | ||
| + | ]); | ||
2017年6月6日 (火) 13:53時点における版
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'
]
]);
