Invalid Http response

0

I have the following code block

public void read( String url ){
       try{
            urlNormal = new URL("http://"+url+"/sistema.cgi?lermc=0,33");
            URLConnection conn = urlNormal.openConnection();
            BufferedReader input = new BufferedReader(new InputStreamReader(conn.getInputStream()));
            String s = null;
            Map<String, String> valores = new HashMap<>();
            int i = 0;
            String nova = "";

            List<String> dadosRecuperados = new ArrayList<String>();
            String[] dadosSeparados = null;
            if (null != (s = input.readLine())) {
                nova = s.replace("[", "").replace("]", "");
                dadosSeparados = nova.split(",");
            }

            for( int j = 0; j< dadosSeparados.length; j++ ){
                System.out.println(dadosSeparados[j]);
            }

               // valores.put( campos[i], s );
            //}
        }
        catch(java.net.MalformedURLException ex){
            System.out.println(ex.getMessage());
        }
        catch(java.io.IOException ex){
            System.out.println(ex.getMessage());
        }
    }

When reading a url, it gives the following message:

  

Invalid Http response

The data that is returned from the url looks like this:

  

[127.63,28.87,3684.71,2621.41,0.71,0.00,0.00,0.00,2589.45,0.00,127.23,29.70,3779.10,-2439.51,-0.65,0.00,0.00,0.00,2886.24,0.00,126.52,29.33,3711.14,-580.26,-0.16,-1.00,-1.00,-1.00,3665.50,59.58,29.30,38.60]

I'd like to know what's wrong

    
asked by anonymous 05.06.2018 / 18:52

0 answers