No content to map due to end-of-input jackson parser

前端 未结 11 1879
盖世英雄少女心
盖世英雄少女心 2020-12-23 19:00

I am getting this response from the server {\"status\":\"true\",\"msg\":\"success\"}

I am trying to parse this json string using Jackson parser library

11条回答
  •  有刺的猬
    2020-12-23 19:12

    I could fix this error. In my case, the problem was at client side. By mistake I did not close the stream that I was writing to server. I closed stream and it worked fine. Even the error sounds like server was not able to identify the end-of-input.

    OutputStream out = new BufferedOutputStream(urlConnection.getOutputStream());
    out.write(jsonstring.getBytes());
    out.close() ; //This is what I did
    

提交回复
热议问题