Package play.libs.ws
Class WSAsync
- java.lang.Object
-
- play.libs.ws.WSAsync
-
- All Implemented Interfaces:
WS.WSImpl
public class WSAsync extends java.lang.Object implements WS.WSImpl
Simple HTTP client to make webservices requests.Get latest BBC World news as a RSS content
HttpResponse response = WS.url("http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml").get(); Document xmldoc = response.getXml(); // the real pain begins here...
Search what Yahoo! thinks of google (starting from the 30th result).
HttpResponse response = WS.url("http://search.yahoo.com/search?p=%s&pstart=1&b=%s", "Google killed me", "30").get(); if (response.getStatus() == 200) { html = response.getString(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WSAsync.HttpAsyncResponse
An HTTP response wrapperclass
WSAsync.WSAsyncRequest
-
Constructor Summary
Constructors Constructor Description WSAsync()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WS.WSRequest
newRequest(java.lang.String url, java.lang.String encoding)
void
stop()
-
-
-
Method Detail
-
newRequest
public WS.WSRequest newRequest(java.lang.String url, java.lang.String encoding)
- Specified by:
newRequest
in interfaceWS.WSImpl
-
-