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 ?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How to work with an Error in Laravel ?

1499


Explain auth.

799


How does laravel handle assets?

856


What are the Writing Gates and Policies ?

1704


How to install laravel via laravel installer.

824


How can we get data between two dates using query in laravel?

776


Explain validations in laravel?

788


What is remember token in laravel?

775


Is laravel object oriented?

751


What is a controller middleware?

815


What do you understand by unit testing?

824


What is the difference between forget() and the pull() method ?

1081


How to set database connection in laravel?

846


How install react js in laravel?

791


How do I add a 3rd party package to your application like laravel-emoji?

723