Skip to content

Instantly share code, notes, and snippets.

@pk11
Created May 19, 2010 03:24
Show Gist options
  • Save pk11/405913 to your computer and use it in GitHub Desktop.
Save pk11/405913 to your computer and use it in GitHub Desktop.
import static com.my.utils.HttpHelper.*;
//Perform a GET
String response = performGet("http://mysite.com");
//do something with response
//Perform a more complex GET
Map<String,String> headers = new HashMap<String,String>();
headers.put("special","header");
String response = performGet("http://mysite.com","john","password",headers);
//do something with response
//Perform a POST
Map<String,String> params = new HashMap<String,String>();
params.put("name","john");
performPost("http://mysite.com",params)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment