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 are pros and cons of using laravel framework?
Is laravel any good?
Please write some additional where clauses in laravel?
What is artisan in laravel?
List the default ports that are forwarded to your homestead environment?
Explain how to upgrade valet to valet 2.0?
How to add multiple and conditions in laravel query?
What are the difference between latest() and oldest() in laravel?
How to share sites with external world on valet?
What are the server requirements for laravel 6.0?
How will you describe bundles in laravel?
What is laravel api rate limit?