laravel - URI 必须是字符串或 UriInterface
问题描述
private function setRequest()
{
$vKey = $this->voltKey;
$vId= $this->voltId;
$this->client = new Client(
[
'base_uri' => $this->url,
'headers' => [
'vkey' => $vKey ,
'vid' => $vId,
'Content-Type' => 'application/json',
'Accept' => 'application/json',
]
]
);
}
private function setApiResponse($body = [])
{
$this->response = $this->client->request('put',
$this->url, ["body" => json_encode($body)]
);
return $this;
}
请从 guzzle 遇到服务器错误.. 请问这有什么问题吗
'Accept' => 'application/json',
因为堆栈跟踪指向该行
解决方案
推荐阅读
- python - 查找数组的连续和
- apache - Apache 2 Forbidden 403 错误,尽管“要求所有授权”
- excel - 我为此使用什么 Excel 函数?
- html - 如何在不影响任何其他元素的情况下使 HTML 元素“浮动”?
- reactjs - React Next js 应用重定向到登录还为时过早
- hadoop - HIVE INSERT INTO 因命名空间配额问题而失败
- scala - 基于泛型的重载方法
- dart - 类'未来
' 没有实例 getter 'length' - javascript - React App:EventSource 的响应具有不是“text/event-stream”的 MIME 类型(“application/json”)。中止连接
- arrays - 试图从嵌套数组中访问值