Created
September 5, 2010 17:04
-
-
Save jvanzyl/566171 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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