What is meant by Attaching Headers ?
Answer / surbhi
The response can be attached to headers using the header() method.
We can also attach the series of headers as shown in the below sample code.
return response($content,$status)
->header('Content-Type', $type)
->header('X-Header-One', 'Header Value')
->header('X-Header-Two', 'Header Value');
Example : Route::get('/header',function(){
return response("Hello", 200)->header('Content-Type', 'text/html');
});
| Is This Answer Correct ? | 0 Yes | 0 No |
What is xss attack with example?
How to generate a controller with resources in laravel?
What developed the laravel?
How to redirect user with flashed session data in laravel?
What are the difference between soft delete & delete in laravel?
How do I populate my database with sample data?
Is laravel an open source?
How to enable/disable maintenance mode in laravel 5?
What service provider’s register method does?
List some use valet commands?
How to configuration laravel?
How to use update statement in laravel?