This blogpost explains the advantages of OkHttp's interface over HttpURLConnection - it neatly supports separation of Request and Response, and offers an asynchronous Call interface:
http://corner.squareup.com/2014/06/okhttp-2.html
In order for github-api to take full advantage of the superior OkHttp API - and to expose it to external users so that users can do async calls to the GitHub API - would probably require commiting to using OkHttp everywhere within the github-api library, removing all usage of HttpURLConnection. This might feel like a big change, but it's mostly an internal one, so hopefully would not substantially impact consumers of the library, other than offering them additional functionality.
Amongst it's many consumers, OkHttp is also the engine that powers HttpUrlConnection as of Android 4.4, so it's a library that has a lot of traction and support.
See the OkHttp 'Recipes' documentation for code usage examples.
Would there be any interest in a pull-request that made this happen?
This blogpost explains the advantages of OkHttp's interface over
HttpURLConnection- it neatly supports separation of Request and Response, and offers an asynchronous Call interface:http://corner.squareup.com/2014/06/okhttp-2.html
In order for
github-apito take full advantage of the superior OkHttp API - and to expose it to external users so that users can do async calls to the GitHub API - would probably require commiting to using OkHttp everywhere within thegithub-apilibrary, removing all usage of HttpURLConnection. This might feel like a big change, but it's mostly an internal one, so hopefully would not substantially impact consumers of the library, other than offering them additional functionality.Amongst it's many consumers, OkHttp is also the engine that powers HttpUrlConnection as of Android 4.4, so it's a library that has a lot of traction and support.
See the OkHttp 'Recipes' documentation for code usage examples.
Would there be any interest in a pull-request that made this happen?