Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

What do you understand by database migrations in laravel? How can we use it?

0 Answers  


How do I require authentication for a set of routes associated with a subdomain?

0 Answers  


What are the Forms in Laravel ?

0 Answers  


Difference between facades vs. Dependency injection?

0 Answers  


Explain few features of laravel?

0 Answers  


How to fetch data from database in laravel?

0 Answers  


Name aggregates methods of query builder.

0 Answers  


Do you know what is method spoofing in laravel?

0 Answers  


What is a Laravel - Localization ?

0 Answers  


What is console in laravel?

0 Answers  


Which file is used to create a connection with the database?

0 Answers  


What are the benefits of laravel?

0 Answers  


Categories