CFLib.org – Common Function Library Project

HTTPHeader([name][, value][, statuscode][, statustext])

Last updated September 20, 2002

author

Kreig Zimmerman

Version: 1 | Requires: CF6 | Library: CFMLLib

Description:
Mimics the CFHEADER tag. Allows you to pass a name/value pair or a statuscode/statustext pair.

Return Values:
Returns nothing.

Example:

<cfscript>
  HTTPHeader(name="Content-Type", value="text/html; charset=iso-8859-1");
  HTTPHeader(name="Content-Language", value="EN-US");
</cfscript>

Parameters:

Name Description Required
name Name used when passing name/value pairs. No
value Value used when passing name/value pairs. No
statuscode Status code used when passing statuscode/statustext pairs. No
statustext Status text used when passing statuscode/statustext pairs. No

Full UDF Source:

<!---
 Mimics the CFHEADER tag.
 
 @param name 	 Name used when passing name/value pairs. (Optional)
 @param value 	 Value used when passing name/value pairs. (Optional)
 @param statuscode 	 Status code used when passing statuscode/statustext pairs. (Optional)
 @param statustext 	 Status text used when passing statuscode/statustext pairs. (Optional)
 @return Returns nothing. 
 @author Kreig Zimmerman (kkz@foureyes.com) 
 @version 1, September 20, 2002 
--->
<cffunction name="HTTPHeader" output="false" returnType="void">
	<cfargument name="name" type="string" default="">
	<cfargument name="value" type="string" default="">
	<cfargument name="statuscode" type="string" default="">
	<cfargument name="statustext" type="string" default="">
	<cfif Len(name) and Len(value)>
		<cfheader name="#name#" value="#value#">
	<cfelseif Len(statuscode) and Len(statustext)>
		<cfheader statuscode="#statuscode#" statustext="#statustext#">
	</cfif>
</cffunction>
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson