的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);
您的問題是? – Nfear
你可以粘貼通過郵遞員發送的請求嗎 – djodjo