Skip to content

Instantly share code, notes, and snippets.

@mrmike
Created April 25, 2013 13:31
Show Gist options
  • Save mrmike/5459700 to your computer and use it in GitHub Desktop.
Save mrmike/5459700 to your computer and use it in GitHub Desktop.
Snippet for creating httpRequests
// Add this template in Preferences > Java > Editor > Templates > New
// I stored this snippet with newRequest name, but you can use any name you want
String url = new GetBuilder(${url}).appendPathSegment(${path})
.build();
Http${type} request = new Http${type}(url);
setupDefaultHeaders(request);
HttpResponse response = getHttpClient().execute(request);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment