我刚刚发现jQuery在LaravelAPI后端有一个非常奇怪的行为。不要担心,不是正常的身份验证等问题。1:使用jQuery时无输出 public function index(Request $request) $items = $this->repository->get();
return response()->json
我在前端和后端(NodeJS)都使用了Fetch API,当我将响应解析为json时,这个问题经常发生。response.json()将返回一个承诺,因此我事先不知道响应的主体是什么,并且当响应体为空时,JSON解析将因错误而失败:
SyntaxError: Unexpected end of input所以我的</em