异常报错:org.springframework.core.io.buffer.DataBufferLimitException: Exceeded limit on max bytes to buffer : 262144
解决方案:
WebClient webClient = WebClient.builder()
.exchangeStrategies(ExchangeStrategies.builder()
.codecs(clientCodecConfigurer -> clientCodecConfigurer
.defaultCodecs()
//这里设置内存大小即可
.maxInMemorySize(10 * 1024 * 1024))
.build())
.build();
Mono<T> mono = webClient.get().uri(url)
.header("Content-Type", "application/json")
.retrieve().bodyToMono(tClass);
T t = mono.block();
本站资源均来自互联网,仅供研究学习,禁止违法使用和商用,产生法律纠纷本站概不负责!如果侵犯了您的权益请与我们联系!
转载请注明出处: 免费源码网-免费的源码资源网站 » WebClient Exceeded limit on max bytes to buffer : 262144
发表评论 取消回复