android com.android.volley.ParseError:org.json.JSONException:Value <br of =“”type =“”java.lang.string =“”can =“”be =“”converted =“”to =“” jsonobject =“”

时间:2018-03-24 07:25:58

标签: php android

=“”
 .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);
    }

0 个答案:

没有答案