我使用抽射发送获取method.Sometimes我有502网关服务器error.I不知道什么是错误的或我怎么能解决我的问题凌空扔502网关
这是一个源代码
public void polygonRequest(final String userID, final String secretKey) {
showpDialog("loading");
polygonModelList.clear();
String url = ServerUtil.polygon+userID+"/"+secretKey;
final JsonObjectRequest jsObjRequest = new JsonObjectRequest(Request.Method.GET, url, null,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
SavedPolygonJson polygonModel=new SavedPolygonJson();
polygonModel.setPolygonJson(response.toString());
polygonModel.saveInStorage();
parsePolygonRequest(response);
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
hidepDialog();
showOneItemDialog(error.toString(),false);
}
});
jsObjRequest.setRetryPolicy(new DefaultRetryPolicy(
10000,
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
CoreApplication.getInstance().getRequestQueue().add(jsObjRequest);
}
当我把我的请求,与浏览器我没有任何errors.How我可以修复这个错误... 我怎么能与排球请求头浏览器的请求头结合? 谢谢
我怎样才能提高凌空重试时间? @ phoenix911 – BekaKK
只是将DefaultRetryPolicy.DEFAULT_MAX_RETRIES更改为0并检查 – phoenix911
为什么0? @ phoenix911 – BekaKK