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 is http middleware?
Explain dependency injection and their types.
What is composer tool?
What is csrf protection in laravel?
How do I turn off csrf protection?
What do you mean by boot & register method used in laravel 5?
Explain binding instances?
How to assign a variable value for all view file?
What is Laravel - Middleware ?
Define @include.
How to install mysql on valet?
What is a Composer command ?