Snippets

Craig Vincent Making HTTP Call using apache commons httpclient from ColdFusion

Created by Craig Vincent last modified
<cfscript>
	oach = 'org.apache.commons.httpclient';
	oachmm = '#oach#.methods.multipart';
	httpVersion = createObject('java', '#oach#.HttpVersion');
	
	httpClient = createObject('java', '#oach#.HttpClient').init();
	httpClient.getParams().setParameter("http.protocol.version", httpVersion.HTTP_1_0);
	
	// Define the request parameters & parts
	method = createObject('java', '#oach#.methods.GetMethod').init(fullUrl);

	// Compile & make the http request
	httpClient.executeMethod(method);
</cfscript>

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.