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

前端 未结 11 1962
盖世英雄少女心
盖世英雄少女心 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:29

    The problem for me was that I read the response twice as follows:

    System.out.println(response.body().string());
    getSucherResponse = objectMapper.readValue(response.body().string(), GetSucherResponse.class);
    

    However, the response can only be read once as it is a stream.

提交回复
热议问题