.erb
这是我的代码,我将JSONObject发送到服务器php,但是显示以下错误: com.android.volley.ParseError:org.json.JSONException:Value
public void sendPostUser(JSONObject jsonObject ,final postSuccess postSuccess) {
JsonObjectRequest request = new JsonObjectRequest(Request.Method.POST, "url",jsonObject, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
try {
JSONObject jsonObject = new JSONObject(response.toString());
String m = jsonObject.get("success").toString();
if(m != null){
postSuccess.success(true);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
postSuccess.success(false);
}
});
request.setRetryPolicy(new DefaultRetryPolicy(18000,DefaultRetryPolicy.DEFAULT_MAX_RETRIES,DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
Volley.newRequestQueue(context).add(request);
}