header: Specifies an HTTP header. Does not URL encode the valuebody: Specifies that the value is the body of the HTTP request.xml: Identifies the request as having a content-type oftext/xml and specifies that the value attribute contains the body of the HTTP request.cgi: Same as header but URL encodes the value by default.file: Tells CFML to send the contents of the specified file.url: Specifies a URL query string name-value pair to append to the cfhttp url attribute. URL encodes the value.formfield: Specifies a form field to send. URL encodes the value by default.cookie: Specifies a cookie to send as an HTTP header. URL encodes the value.
headerbodyxmlcgifileurlformfieldcookiebody and xml type. For file type, specifies the filename.
file type. The value must contain string data or data that CFML can convert to a string for all type attributes except Body. Body types can have string or binary values.
file type; ignored for all other types. The absolute path to the file that is sent with the request.
formfield and cgi types; ignored for all othertruefalsefile type; invalid for all other types.text/plaintext/html, <bx:httpparam>` in BoxLang
cfhttp(method="POST", charset="utf-8", url="https://www.google.com/", result="result") {
cfhttpparam(name="q", type="formfield", value="cfml");
}
writeDump(result);
httpService = new http(method = "POST", charset = "utf-8", url = "https://www.google.com/");
httpService.addParam(name = "q", type = "formfield", value = "cfml");
result = httpService.send().getPrefix();
writeDump(result);
<cfhttp result="result" method="POST" charset="utf-8" url="https://www.google.com/">
<cfhttpparam name="q" type="formfield" value="cfml">
</cfhttp>
<cfdump var="#result#">
Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.