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 |
Where is route in laravel?
How to send mail using queue in laravel 5?
How will you explain middleware in laravel?
Where is the authentication configuration file is located in laravel?
What is cross site request forgery with example?
Name the first file that loaded in laravel?
Is laravel safe from sql injection?
What is the latest version of laravel?
What is the use of accessors and mutators in eloquent?
Explain to listeners.
Explain how to install installing mariadb on homestead?
How will you explain homestead in laravel?