Lasso Soft Inc. > Home

[ web_response->replaceHeader ]

Method

The [web_response->replaceHeader] method is used to change the contents of an existing header name+value pair being returned to the client browser.

  • Syntax
web_response->replaceHeader(name = value)
Examples
  • Beginner

To customize the "X-Powered-By" header returned to the client browser:

Use the [web_response->replaceHeader] method.

Code

web_response->replaceHeader('X-Powered-By' = 'Lasso 9 + LEAP 5')
// return the web_response->headers for demonstration purposes
web_response->headers

Result

array((Content-Type = text/html; charset="UTF-8"), (X-Powered-By = Lasso 9 + LEAP 5))

To force a file to be downloaded and set as an MS Excel file type:

Use the [web_response->replaceHeader] method.

Code

web_response->replaceHeader('Content-type' = 'application/vnd.ms-excel')
web_response->replaceHeader('Content-Disposition' = 'attachment;filename=your_file_name.xls')

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft