Java simple code: java.net.SocketException: Unexpected end of file from server

后端 未结 8 1764
盖世英雄少女心
盖世英雄少女心 2020-12-01 10:23

I wrote some simple code in Java, the method should connect to the website and return the BufferedReader.

private BufferedReader getConnection(String url_a)          


        
8条回答
  •  被撕碎了的回忆
    2020-12-01 10:41

    Most likely the headers you are setting is incorrect or not acceptable.

    Example: connnection.setRequestProperty("content-type", "application/json");

提交回复
热议问题