我正在嘗試application/json使用 Spring RestTemplate返回一個帶有 content-type 的 json String 的服務(wù)。響應(yīng)如下所示:============================response begin==========================================response: 200 OKHeaders Content-Length : 108 Content-Type : application/json; charset=utf-8Response Body : "a string with double quotes, JSON valid"=======================response end=================================================現(xiàn)在,當(dāng)我使用:String result = template.postForObject("http://...", request, String.class)結(jié)果總是包含"\"a string with double quotes, Json valid\"",而我想接收它轉(zhuǎn)義,"a string with double quotes, Json valid"。我也想收到這個答案而不必解析它。對我來說,這似乎是一個微不足道的問題,但我還沒有在網(wǎng)上找到任何 SO 問題或其他資源。
添加回答
舉報
0/150
提交
取消