aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/README.md b/README.md
index 68b5903..947ae11 100644
--- a/README.md
+++ b/README.md
@@ -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