|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Objectplay.PlayPlugin
play.libs.WS
public class WS
Simple HTTP client to make webservices requests.
Get latest BBC World news as a RSS contentHttpResponse 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(); }
嵌套类摘要 | |
---|---|
static class |
WS.FileParam
|
static class |
WS.HttpResponse
An HTTP response wrapper |
static class |
WS.Scheme
|
static interface |
WS.WSImpl
|
static class |
WS.WSRequest
|
static class |
WS.WSWithEncoding
Internal class exposing all the methods previously exposed by WS. |
字段摘要 |
---|
从类 play.PlayPlugin 继承的字段 |
---|
index |
构造方法摘要 | |
---|---|
WS()
|
方法摘要 | |
---|---|
static java.lang.String |
encode(java.lang.String part)
URL-encode a string to be used as a query string parameter. |
void |
onApplicationStart()
Called at application start (and at each reloading) Time to start stateful things. |
void |
onApplicationStop()
Called at application stop (and before each reloading) Time to shutdown stateful things. |
static WS.WSRequest |
url(java.lang.String url)
Build a WebService Request with the given URL. |
static WS.WSRequest |
url(java.lang.String url,
java.lang.String... params)
Build a WebService Request with the given URL. |
static WS.WSWithEncoding |
withEncoding(java.lang.String encoding)
Use thos method to get an instance to WS with diferent encoding |
从类 java.lang.Object 继承的方法 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
构造方法详细信息 |
---|
public WS()
方法详细信息 |
---|
public static WS.WSWithEncoding withEncoding(java.lang.String encoding)
encoding
- the encoding to use in the communication
public void onApplicationStop()
PlayPlugin
复制的描述
PlayPlugin
中的 onApplicationStop
public void onApplicationStart()
PlayPlugin
复制的描述
PlayPlugin
中的 onApplicationStart
public static java.lang.String encode(java.lang.String part)
part
- string to encode
public static WS.WSRequest url(java.lang.String url)
url
- of the request
public static WS.WSRequest url(java.lang.String url, java.lang.String... params)
url
- to format using the given params.params
- the params passed to format the URL.
|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |