我使用抽射發送獲取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