libgdx/libgdx — pull request #2691 by nooone (2014-12-30 21:02:10+00:00)
Title: Added a HttpRequestBuilder

When working with Gdx.net to communicate with a JAX-RS webservice, I noticed that a small utility like this makes working with HttpRequests a lot more comfortable.

It's a pretty standard builder pattern with built-in pooling. Furthermore it offers some small additional features like a default timeout or a base-URL that can be set to avoid having to prepend the same IP/domain address for every request, when communicating with just a single server (which should be the most common case). Last, but not least, it offers two methods to form-encode and JSON-encode the request content as well as a method to implement HTTP basic authentication.