1 回答
TA贡献1810条经验 获得超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 关注
- 221 浏览
添加回答
举报
