Problem in special characters ( keys, parentheses, etc. ) that contains a json that I'm sending via GET . The android generates the following log:
> E/AndroidRuntime(1956): java.lang.IllegalArgumentException: Illegal
> character in path at index 61:
> http://10.0.3.2:8084/meuapp/recurso/objeto/download/{}
My GET method is as follows
public static String GET(Context context, String endereco){
//Verifica se existe conexão com a internet
if(!existeConexao(context))
return K.FALHA_CONEXAO;
InputStream inputStream = null;
HttpClient httpClient = new DefaultHttpClient();
String result = K.FALHA;
try{
HttpGet httpGet = new HttpGet(endereco);//A excessão acontece aqui
HttpResponse httpResponse = httpClient.execute(httpGet);
inputStream = httpResponse.getEntity().getContent();
if(inputStream!=null){
//Converte resposta do WebService para String
result = inputStreamParaString(inputStream);
}else
result = K.FALHA;
}catch(UnsupportedEncodingException e){
e.printStackTrace();
}catch(ClientProtocolException e){
e.printStackTrace();
}catch(IOException e){
e.printStackTrace();
}
return result;
}