User Guide

184 Chapter 2: ColdFusion Tags
Attributes
Usage
Specifies header or body data to send in the HTTP request. The type attribute identifies the
information that the parameter specifies. A
cfhttp tag can have multiple cfhttpparam tags,
subject to the following limitations:
An XML type attribute cannot be used with additional XML type attributes, or with body, file,
or
formField type attributes.
Attribute Req/Opt Default Description
type Required Information type:
Header: The parameter specifies an HTTP header.
ColdFusion does not URL encode the header.
CGI: Specifies an HTTP header. ColdFusion URL
encodes the header by default.
Body: Specifies the body of the HTTP request.
ColdFusion does not URL encode the body contents.
XML: Identifies the request as having a content-type of
text/xml. Specifies that the value attribute contains the
body of the HTTP request. Used to send XML to the
destination URL. ColdFusion does not URL encode the
XML data.
File: Tells ColdFusion to send the contents of the
specified file. ColdFusion does not URL encode the file
contents
URL: Specifies a URL query string name-value pair to
append to the
cfhttp url attribute. ColdFusion URL
encodes the query string.
FormField: Specifies a form field to send. ColdFusion
URL encodes the Form field by default.
Cookie: Specifies a cookie to send as an HTTP
header. ColdFusion URL encodes the cookie.
name Required.
Optional for
Body and XML
types
Variable name for data that is passed. Ignored for Body
and XML types. For File type, specifies the filename to
send in the request.
value Required
Optional (and
ignored) for File
type
Value of the data that is sent. Ignored for File type. The
value must contain string data or data that ColdFusion can
convert to a string for all
type attributes except Body. Body
types can have string or binary values.
file Required only if
type="File"
Applies to File type; ignored for all other types. The
absolute path to the file that is sent in the request body.
encoded Optional Yes Applies to FormField and CGI types; ignored for all other
types. Specifies whether to URLEncode the form field or
header.
mimeType Optional Applies to File type; invalid for all other types. Specifies the
MIME media type of the file contents. The content type
can include an identifier for the character encoding of the
file; for example, text/html; charset=ISO-8859-1 indicates
that the file is HTML text in the ISO Latin-1 character
encoding.