我正在嘗試application/json使用 Spring RestTemplate返回一個帶有 content-type 的 json String 的服務。響應如下所示:============================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=================================================現在,當我使用:String result = template.postForObject("http://...", request, String.class)結果總是包含"\"a string with double quotes, Json valid\"",而我想接收它轉義,"a string with double quotes, Json valid"。我也想收到這個答案而不必解析它。對我來說,這似乎是一個微不足道的問題,但我還沒有在網上找到任何 SO 問題或其他資源。
添加回答
舉報
0/150
提交
取消