![](/img/trans.png)
[英]REST Assured - How do I instigate “Transfer-Encoding: chunked” - I currently get apache error “Transfer-encoding header already present”
[英]How do I deal with transfer-Encoding chunked json using Spring RestTemplate
我幾天前在下方發布了此錯誤,並且有多個響應。 有人建議,當響應為transfer-Encoding類型分塊時出現錯誤。 我該怎么做才能告訴服務器不要分塊或修復我的端頭,以便ReadTemplate可以正常工作。 而且,順便說一句,如果知道這很有用,我會從WeatherUndergound的REST服務中閱讀。
Could not extract response: no suitable HttpMessageConverter found for
response type [net.cheshiresgrin.currentConditions.Display] and
content type [application/json;charset=UTF-8]
restTemplate.getMessageConverters().add(new MappingJackson2HttpMessageConverter());
並在pom文件中添加Maven依賴項
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${com.fasterxml.jackson.version}</version>
</dependency>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.