Skip to content

Instantly share code, notes, and snippets.

@jvanzyl
Created September 5, 2010 17:04
Show Gist options
  • Save jvanzyl/566171 to your computer and use it in GitHub Desktop.
Save jvanzyl/566171 to your computer and use it in GitHub Desktop.
package org.sonatype.idiom.site;
import java.io.IOException;
import javax.inject.Named;
import javax.inject.Singleton;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.PostMethod;
@Named
@Singleton
public class Loopfuser
{
private void loopfuse()
{
HttpClient client = new HttpClient();
PostMethod post = new PostMethod("http://loopfuse.net/webrecorder/post");
NameValuePair[] data =
{
new NameValuePair( "id", "bd0d3e53-4264-4039-8a0c-50a8c6f00bdb" ),
new NameValuePair( "name", "Product Download Form" ),
new NameValuePair( "title", "Product Download Registration Form" ),
};
post.setRequestBody(data);
try
{
int response = client.executeMethod( post );
if ( response == HttpStatus.SC_OK )
{
}
}
catch ( HttpException e )
{
}
catch ( IOException e )
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment