diff options
-rw-r--r-- | README.md | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -25,6 +25,25 @@ AsyncHttpClient.getDefaultInstance().get(url, new AsyncHttpClient.StringCallback ```
+### Download a JSON Object
+
+```java
+// url is the URL to download. The callback will be invoked on the UI thread
+// once the download is complete.
+AsyncHttpClient.getDefaultInstance().get(url, new AsyncHttpClient.JSONObjectCallback() {
+ // Callback is invoked with any exceptions/errors, and the result, if available.
+ @Override
+ public void onCompleted(Exception e, JSONObject result) {
+ if (e != null) {
+ e.printStackTrace();
+ return;
+ }
+ System.out.println("I got a JSONObject: " + result);
+ }
+});
+```
+
+
### Download a url to a file
|