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 |
Explain about laravel project?
What does xss stand for?
Explain the concept of contracts in laravel.
What does csrf token in laravel 5?
Explain fluent query builder in laravel.
How do you generate urls?
What is Route Parameters ?
Explain traits in laravel.
What is bootstrap in laravel?
Explain the request life cycle of laravel?
what is Blade ?
What is seeding in laravel?