php - 在 Guzzle 中获取请求
问题描述
我是 Guzzle 的新手,我正在尝试从我的 api 获取请求
这是我现在拥有的:
$client = new Client(['base_uri' => 'https://api.harvestapp.com']);
$request = $client->request('GET', '/v2/time_entries', [
'headers' => [
'Authorization' => 'Bearer bearer_key',
'Harvest-Account-ID' => 'account_id_key']
]);
$request = json_decode($request);
return new JsonResponse($request);
}
我希望有人可以帮助我!
解决方案
推荐阅读
- flutter - 颤振按钮顶部有间距
- jenkins - 如何在一个阶段内创建全局变量以便我可以在另一个阶段以及管道脚本中使用它
- amazon-web-services - AWS api 网关中的代理资源 API 返回所有 url 的最后缓存响应
- java - 使用 Java 为 TextFile 内容中的每个单词建立索引
- java - 在 JVM 上加载 JavaAgent
- javascript - 如何使用 javascript 过滤功能列出从 laravel 到 vue 的多个对象?
- javascript - 将一个数组合并为 1
- excel - VBA - 范围对象的偏移量(命名引用)
- uwp - 如何在悬停 TextBlock 上进行前景更改?
- javascript - jquery选择器不适用于动态值