0

We trying to getting Json response which are services developed in .net webservice. But we are getting error is

   java.lang.IllegalArgumentException: Illegal character in path at index 58: 
url/[{'Region':null,'Zone':null,'Club':null,'Name':null,'Mobile':'12437','BloodGroup':null}]

We used code is:

 HttpPost httppost = new HttpPost(J_URL);//passing URL
// Depends on your web service
                httppost.setHeader("Content-type", "application/json");

                InputStream inputStream = null;
                String result = null;
                try {
                    HttpResponse response = httpclient.execute(httppost);
                    HttpEntity entity = response.getEntity();

                    inputStream = entity.getContent();
                    // json is UTF-8 by default
                    BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"), 8);
                    StringBuilder sb = new StringBuilder();

                    String line = null;
                    while ((line = reader.readLine()) != null) {
                        sb.append(line + "\n");
                    }
                    result = sb.toString();
                    Log.d("Response", result);
                } catch (Exception e) {
                    // Oops
                } finally {
                    try {
                        if (inputStream != null) inputStream.close();
                    } catch (Exception squish) {
                    }
                }

Please do needful Advance Thanks

0 Answers0