Generates an HTTP request and parses the response from the server into a structure. The result structure has the following keys:statusCode : The HTTP response code and reason string.fileContent : The body of the HTTP response. Usually a string, but could also be a Byte Array.responseHeader : A structure of response headers, the keys are header names and the values are either the header value or an array of values if multiple headers with the same name exist.errorDetail : An error message if applicable.mimeType : The mime type returned in the Content-Type response header.text : a boolean indicating if the response body is text or binary.charset : The character set returned in the Content-Type header.header : All the http response headers as a single string.
<cfhttp url="">
cfhttp(url="");
80/443getgetpostputdeleteheadtraceoptionspatch80ColdFusionutf-8iso-8859-1windows-1252us-asciishift_jisiso-2022-jpeuc-jpeuc-krbig5euc-cnutf-16falsetruetrueautoautonoyesnevercfhttptrue""'path attribute.
falsefalsetrueform-dataform-datarelatedBASICBASICNTLMtruetruefalse<bx:http> in BoxLang
cfhttp(method="GET", charset="utf-8", url="https://www.google.com/", result="result") {
cfhttpparam(name="q", type="url", value="cfml");
}
writeDump(result);
httpService = new http(method = "GET", charset = "utf-8", url = "https://www.google.com/");
httpService.addParam(name = "q", type = "url", value = "cfml");
result = httpService.send().getPrefix();
writeDump(result);
<cfhttp result="result" method="GET" charset="utf-8" url="https://www.google.com/">
<cfhttpparam name="q" type="url" 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.