无法解码网络电量中的构成响应
我试图使用WebClient调用后端,这是“块”响应。但是,似乎StringDecoder未能解码构成块的响应。 但是,正如我可以看到的以下行记录的
LN="o.s.c.c.StringDecoder" [3d736ae4] Decoded "?�????????�V�RPPPrO-?J-.��+NU�R220P(.MNN-.N+�Q�?+).I,)-�?�%�??)(y$??T*?$�d(��?)���(䦖d�(q�r??���}X???"
那样,后端的实际响应是普通的JSON,具有以下响应标头:
Content-Encoding : gzip
Vary : Accept-Encoding, User-Agent
Transfer-Encoding : chunked
找不到SO上的任何类似的帖子,可以指向使用WebClient处理块类型响应。
WebClient部分的代码片段:
Mono<ResponseEntity<String>> response = client.get().uri(url)
.retrieve();
.onStatus(HttpStatus::isError, t -> Mono.empty())
.toEntity(String.class);
I was trying to call a backend using webclient, which is "chunked" response. But, it appears StringDecoder failed to decode chunked response. As I can see following line logged
LN="o.s.c.c.StringDecoder" [3d736ae4] Decoded "?�????????�V�RPPPrO-?J-.��+NU�R220P(.MNN-.N+�Q�?+).I,)-�?�%�??)(y$??T*?$�d(��?)���(䦖d�(q�r??���}X???"
However, actual response from backend is plain json with following response header :
Content-Encoding : gzip
Vary : Accept-Encoding, User-Agent
Transfer-Encoding : chunked
Couldn't find any similar post on SO, which could point to handle chunked type response using webclient.
Code snippet of webclient part :
Mono<ResponseEntity<String>> response = client.get().uri(url)
.retrieve();
.onStatus(HttpStatus::isError, t -> Mono.empty())
.toEntity(String.class);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论