I'm trying to send a bunch of gzip compressed data (basically a json, compressed using gzip) to my Spring Web Flux application.
I'm currently using Postman as my web client, and sending the data via request payload (Body -> raw). Here's a glimpse of my payload.
[31, -117, 8, 0, 0, 0, 0, 0, 0, 0, -51, ... (there's a lot more)
Using the Content-Type: application/json and Content-Encoding:gzip.
And this is how I'm extracting the data out of the http server request.
Mono<DataBuffer> dataBufferMono = request.flatMap(req -> req.bodyToMono(DataBuffer.class)
//...stuff to get dataBuffer out of Mono
byte[] byteArray = IOUtils.toByteArray(dataBuffer.asInputStream());
This byteArray I extracted should be the one that is sent from the client. But the problem is, it isn't. Here's a glimpse of what I received.
[91, 51, 49, 44, ... (there's a lot more)
Where am I doing it wrong? I'm stuck at work with this issue, any help will be greatly appreciated.
Note: I have also tried changing the Content-Type to octet-stream, but no luck! Also tried using ByteBuffer instead of DataBuffer, never worked.