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 do laravel facades work?
Explain how to do subdomain routing in laravel?
Write down the name of some aggregates methods provided by the laravel's query builder.
How to set database connection in laravel?
What is namespace laravel?
What is eager loading in laravel?
Define laravel guard.
Is laravel spark free?
What is xss attack with example?
What is a facade?
What are the requirements for laravel 5.8?
How can we handle Error Handling in Laravel ?