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 do you mean by route groups used in laravel 5?
What are view composers?
What is schema in laravel?
Do you know what is http middleware?
What is laravel good for?
What is technology service provider?
How to Configuration Laravel - Encryption ?
Which class is used to handle exceptions?
What are laravel eloquent?
What are enhancement features in laravel 5.8?
Explain how to register a service provider via composer in laravel?
are you able to laravel create-project via composer, explain how?