2016-04-22 116 views
1

的Android排球POST方法錯誤BasicNetwork.performRequest:意外的響應碼503

BasicNetwork.performRequest:意外的響應碼503

發佈請求發送到服務器。

Map<String, String> jsonParams = new HashMap<String, String>(); 

jsonParams.put("LoginForm[email]",email); 
jsonParams.put("LoginForm[password]",password); 
jsonParams.put("TOKEN", token); 

JsonObjectRequest postRequest = new JsonObjectRequest(Request.Method.POST, URL, 
     new JSONObject(jsonParams), 
     new Response.Listener<JSONObject>() { 
      @Override 
      public void onResponse(JSONObject response) { 
       // on Response 
      } 
     }, 
     new Response.ErrorListener() { 
      @Override 
      public void onErrorResponse(VolleyError error) { 
       // on Error Response 
      } 
     }) { 
    @Override 
    public Map<String, String> getHeaders() throws AuthFailureError { 
     HashMap<String, String> headers = new HashMap<String, String>(); 
     headers.put("Content-Type", "application/json; charset=utf-8"); 
     headers.put("User-agent", System.getProperty("http.agent")); 
     return headers; 
    } 
}; 
RequestQueue requestQueue = Volley.newRequestQueue(getActivity()); 
requestQueue.add(postRequest); 
+0

您的問題是? – Nfear

+0

你可以粘貼通過郵遞員發送的請求嗎 – djodjo

回答

0

503是由於..

503服務不可用

服務器由於服務器的暫時超載或維護是目前無法處理該請求。這意味着這是暫時的情況,經過一段時間後會緩解。如果已知,則可以在Retry-After標題中指示延遲的長度。如果沒有給出Retry-After,那麼客戶端應該處理響應,就像處理500響應一樣。

請參閱this

+0

但是在這個API中沒有任何服務器錯誤,因爲如果我通過郵遞員使用這個API,那麼它工作正常。 –

+0

@RanjeetKushwaha參考[this](http://pcsupport.about.com/od/findbyerrormessage/a/503error.htm)也..這會給你一個想法 – Sanoop

+0

@RanjeetKushwaha根據這個[線程](http:///androidqueries.com/%93delete-account-failed-%96-503-service-unavailable%94-error-message-android-31391.html)嘗試清除緩存,重新啓動並重試 – Sanoop

相關問題