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 do you understand by database migrations in laravel? How can we use it?
How do I require authentication for a set of routes associated with a subdomain?
What are the Forms in Laravel ?
Difference between facades vs. Dependency injection?
Explain few features of laravel?
How to fetch data from database in laravel?
Name aggregates methods of query builder.
Do you know what is method spoofing in laravel?
What is a Laravel - Localization ?
What is console in laravel?
Which file is used to create a connection with the database?
What are the benefits of laravel?