What is meant by Attaching Headers ?



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

Post New Answer

More Laravel PHP Framework Interview Questions

How to share sites with external world on valet?

0 Answers  


What are cookies? How to get, set, distroy cookies in laravel?

0 Answers  


What is meant by Attaching Cookies ?

1 Answers  


What is laravel boilerplate?

0 Answers  


What is laravel?

0 Answers  






What is laravel vue?

0 Answers  


How to redirect form controller to view file in laravel?

0 Answers  


How to generate application key in laravel?

0 Answers  


What are redirect responses?

0 Answers  


What do you maen by method spoofing in laravel 5?

0 Answers  


Tell me what are system requirement for laravel 5.0?

0 Answers  


What is meant by Modularity ?

0 Answers  


Categories