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 csrf protection token?
what is Laravel-Routing ?
What is meant by Laravel - Validation ?
Explain how to generate pretty urls in laravel?
How to assign a variable value for all view file?
What directories that need to be writable laravel installation?
Can you update homestead? If yes, how?
What is chunk in laravel?
What is meant by Implicit Controllers
Explain the concept of cookies.
What are Global Middleware and Route Middleware ?
Explain short notes on Laravel - Artisan Console and commands ?