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 |
How to use where null and where not null eloquent query in laravel?
What are bundles, reverse routing and the ioc container?
Define lumen.
What is meant by Attaching Cookies ?
How to check ajax request in laravel?
What is the default session timeout duration and how can it be set?
What is blueprint in laravel?
Explain named routes in laravel?
What the server requirements for laravel?
How to resolve class instance out of the container in laravel?
What is a Encryption Process ?
List the software’s included in laravel homestead?