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 |
Is any server permissions required for laravel?
Explain how to configure cron jobs in homestead?
Is laravel an open source?
What is an observer?
What is laravel echo?
What are the Versions Laravel - Understanding Release Process ?
What is service provider in laravel?
Explain auth.
What is stack channel?
How to access session data?
What are the main features of laravel?
Tell me what are the official packages provided by laravel?