Fetch the repository succeeded.
This action will force synchronization from 捣鼓/forest, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
OnSuccess - 请求成功:
@Request(
url = "http://dwz.cn/create.php",
type = "post",
dataType = "json"
)
String testOnSuccess(@DataParam("url") String url, OnSuccess<Map> onSuccess);
...
client.testOnSuccess("https://github.com/mySingleLive", new OnSuccess<Map>() {
public void onSuccess(Map data, ForestRequest request, ForestResponse response) {
System.out.println(data);
assertNotNull(data);
assertEquals(data.get("status"), 0);
}
});
OnError - 请求失败:
@Request(url = "http://this_is_a_error_address", timeout = 10)
String testError(OnError onError);
...
client.testError(new OnError() {
public void onError(ForestRuntimeException ex, ForestRequest request) {
assertNotNull(ex);
assertNotNull(request);
}
});
Sign in for post a comment
Comment ( 0 )