OkHttp is lightweight and powerful when combined with Retrofit as well. This works well for general Java use as well as on Android.
OkHttp: http://square.github.io/okhttp/
public static final MediaType JSON
= MediaType.parse("application/json; charset=utf-8");
OkHttpClient client = new OkHttpClient();
String post(String url, String json) throws IOException {
RequestBody body = RequestBody.create(JSON, json);
Request request = new Request.Builder()
.url(url)
.post(body)
.build();
Response response = client.newCall(request).execute();
return response.body().string();
}
Retrofit: http://square.github.io/retrofit/
public interface GitHubService {
@GET("/users/{user}/repos")
Call> listRepos(@Path("user") String user);
}