java异常: java.io.EOFException: No content to map to Object due to end of input org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:2433) [jackson-mapper-asl-1.8.1.jar:1.8.1] at org.codehaus.jackson.map.ObjectMapper._readValue(ObjectMapper.java:2366) [jackson-mapper-asl-1.8.1.jar:1.8.1] at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1162) [jackson-mapper-asl-1.8.1.jar:1.8.1] at org.codehaus.jackson.jaxrs.JacksonJsonProvider.readFrom(JacksonJsonProvider.java:410) [jackson-jaxrs-1.8.1.jar:1.8.1]
报这个错误,原因是代码中在调用conn.getInputStream方法前调用了conn.getResponseCode,这是不对的,因为使用httpURLconnection时候,一定要注意,当调用conn.getInputStream的时候所有的数据才发送出去。