php - continuation of of Error parsing data org.json.JsonException: Value <!DOCTYPE -
I posted many answers here and on Google and still confused why I am getting this error I made JSN step I have not been allowed to read. I changed permissions to allow everyone and it did not solve the error. I also played my IP address using my computer's IP address 196 ... and online examples of 127.0.0.1 When I use my IP, I get an error. When I used 127.0 then I failed to join the error, which I feel because IP address is not anywhere. I checked my PHP code and this input data in MySQL db. So I know that my problem is in my Java code. I am posting my code below and trying to post the minimum code, so I dump the code. If you want to post more code to me, please tell me
try {// check the request method to check if (method.equals ("POST")) {// request method POST / / Default is the HTTP client default HTT Client httpClient = new DefaultHttpClient (); Http post http post = new HTTP post (url); HttpPost.setEntity (new UrlEncodedFormEntity (params)); HttpResponse httpResponse = httpClient.execute (httpPost); HttpEntity httpEntity = httpResponse.getEntity (); Is = httpEntity.getContent (); } Else if (method.equals ("GET")) {// Request method GET DefaultHttpClient httpClient = New DefaultHttpClient (); String Paratrating = URL encoded utility. Format (Params, "UTF-8"); Url + = "?" + Ultimate String; HttpGet httpGet = New HTTPAJT (URL); HttpResponse httpResponse = httpClient.execute (httpGet); HttpEntity httpEntity = httpResponse.getEntity (); Is = httpEntity.getContent (); }} Hold (unsupported encoding exception e) {e.printStackTrace (); } Hold (Client Protocol E) e.printStackTrace (); } Hold (IOException e) {e.printStackTrace (); } {BufferedReader Reader = Try New BufferedReader (New InputStreamReader (iso-8859-1 "), 8); Stringbilder sb = new stringbiller (); String line = null; While ((line = reader. Readline ())! = Null () {sb.append (row + "\ n"); } is close(); Json = sb.toString (); } Hold (exception e) {Log.e ("buffer error", "error in changing result" + e.toString ()); } / / Try to parse the string for the JSON object {jObj = new JSONObject (json); } Hold (JasonAxception E) {Log.e ("Jason Parser", "Error parsing data" + E.Streatin ()); } // return json string return jObj;
So what do I need to do to get permission?
I get the error message
hold (exception e) {log e ("buffer error", "error in result change" + e.toString ()); }
is:
data parsing error org.json.JSONException: DOCTYPE type of value can not be changed in java.lang.String JSONObject
Comments
Post a Comment