1 回答

TA貢獻(xiàn)1810條經(jīng)驗 獲得超4個贊
->可用于訪問對象屬性。查看以下示例:
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.imgur.com/3/image', [
'headers' => [
'authorization' => 'Client-ID ' . 'my_id',
'content-type' => 'application/x-www-form-urlencoded',
],
'form_params' => [
'image' => base64_encode(file_get_contents($request->file('image')->path()))
],
]);
$response = json_decode($response->getBody()->getContents()));
// get the results:
$id = $response->data->id;
$height = $response->data->height;
- 1 回答
- 0 關(guān)注
- 200 瀏覽
添加回答
舉報