The documentation says:
The
jsonmethod will automatically set theContent-Typeheader toapplication/json
But if I have a route in api.php or web.php and return an array in it, that header is also put.
Route::get('test', function () {
return [
'test' => 'test'
];
});
Does it make sense to write extra code response()->json(...) if you can do so?

accept: application/jsonLaravel will try to return JSON. It may be the case that if you return "non HTML" (noview()) it tries to convert to JSON.