0

I have tried multiple solutions here but none seem to work. I am getting error at String imageJsonStr = sh2.makeServiceCall(imgUrl[i], ServiceHandler.GET); There are no special characters in string and variable imageId is a string containing only numbers like '98546214265231'

                             imgUrl[i] = "https://graph.facebook.com/v2.2/"
                                        + imageId
                                        + "?access_token="
                                        + static_token;                                                 
                                try {

                                    try {
                                        imgUrl[i] = URLEncoder.encode(imgUrl[i],"UTF-8");
                                    } catch (UnsupportedEncodingException e) {
                                        // TODO Auto-generated catch block
                                        e.printStackTrace();
                                    }
                                    String imageJsonStr = sh2.makeServiceCall(
                                            imgUrl[i], ServiceHandler.GET);
Harshil Pansare
  • 1,117
  • 1
  • 13
  • 37

1 Answers1

1

Java URL encoding of query string parameters refer this.. you need not encode the entire url .. encode only the parmaters

Community
  • 1
  • 1
Dinesh Kannan
  • 1,255
  • 13
  • 32