我在 android 中使用 RoboSpice 进行 Rest Api 调用,我想在调用中添加 30 秒的连接超时,我会怎么做?
这是我的代码
public class AddBrandsService extends
SpringAndroidSpiceRequest<AddBrands.Response> {
public final AddBrands.Response loadDataFromNetwork(){
return getRestTemplate().postForObject(url,
request, AddBrands.Response.class);
}
}
this service is called here
private SpiceManager contentManager = new SpiceManager(
JacksonSpringAndroidSpiceService.class);
contentManager.execute(service, lastRequestCacheKey,
DurationInMillis.ONE_SECOND, new AddBrandsListner());
提前致谢...