Hey guys so i'm making a restful api and i decided to make a middleware that always sets the header as content-type application/json however the problem is that it never does that.. when i send the request in postman it still says the content-type is text/html despite the middleware.. to be clearer here is my middleware :
class EnforceJSON
{
public function handle($request, Closure $next)
{
$response = $next($request);
$response->headers->set('Content-Type', 'application/json');
return $response;
}
}
and even after setting the middleware in web.php for the routes i still get this in postman