|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||
See:
Description
| Class Summary | |
|---|---|
| RobustResty | Like Resty, but won't throw IOException on http errors Check responseCode with http().getResponseCode() on resulting resources |
| RobustTextResource | |
| RobustXMLResource | |
| Exception Summary | |
|---|---|
| RestyException | IOExceptions caused by non http 200 OK responses and containing a response message are wrapped in RestyExceptions that also embeds the requested resource |
import static us.monoid.web.Resty.*;
import us.monoid.web.Resty;
...
Resty r = new Resty();
// r.authenticate(...,..,..);
// Look up postal code 66780 in Germany and extract the name of the place from the JSON.
String cityName = r.json("http://ws.geonames.org/postalCodeLookupJSON?postalcode=66780&country=DE").
get("postalcodes[0].placeName").toString();
...
|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||