I have this in response headers:
Response headers (165 B)
Host
"localhost:8000"
[Learn More]
Connection
"close"
[Learn More]
Content-Type
"text/html; charset=UTF-8"
[Learn More]
Date
"Thu, 16 Mar 2017 14:33:53 GMT"
[Learn More]
Transfer-Encoding
"chunked"
My controller is quite simple:
public function login(Request $request){
return response()->json([
'name' => 'Abigail',
'state' => 'CA'
]);
}
Im using angular for post.
Laravel provides modify header information using Response class.
Try this way in your controller :
$contents = View::make('embedded')->with('foo', $foo);
$response = Response::make($contents, $statusCode);
$response->header('Content-Type', 'text/plain');
return $response;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With