将POST请求中的二进制输入数据(gzip压缩)发送到Spring Web Flux

Ary*_*kat 8 java spring gzip binary-data spring-webflux

我正在尝试将一堆gzip压缩数据(基本上是json,使用gzip压缩)发送到我的Spring Web Flux应用程序.

我目前正在使用Postman作为我的Web客户端,并通过请求有效负载(Body - > raw)发送数据.这是我的有效载荷的一瞥.

[31, -117, 8, 0, 0, 0, 0, 0, 0, 0, -51, ... (there's a lot more)
Run Code Online (Sandbox Code Playgroud)

使用Content-Type:application/jsonContent-Encoding:gzip.

这就是我从http服务器请求中提取数据的方式.

Mono<DataBuffer> dataBufferMono = request.flatMap(req -> req.bodyToMono(DataBuffer.class)
//...stuff to get dataBuffer out of Mono
byte[] byteArray = IOUtils.toByteArray(dataBuffer.asInputStream());
Run Code Online (Sandbox Code Playgroud)

我提取的byteArray应该是从客户端发送的.但问题是,事实并非如此.这是我收到的一瞥.

[91, 51, 49, 44, ... (there's a lot more)
Run Code Online (Sandbox Code Playgroud)

我在哪里做错了?我坚持工作这个问题,任何帮助将不胜感激.

注意:我也尝试将Content-Type更改为八位字节流,但没有运气!也尝试使用ByteBuffer而不是DataBuffer,从未奏效.