315 Star 3.4K Fork 733

dromara / forest

 / 详情

POST 请求体出错

Backlog
Opened this issue  
2023-04-10 14:14

当前使用Forest版本以及所使用的后端及版本

Forest: 1.5.30
Backend: okhttp

该问题是如何引起的?

        final byte[] compress = GZIPUtils.compress(xml);

        final String gzip = Forest.post("http://localhost:8080/api/v1/yidam/receive")
                .addHeader("Content-Encoding", "gzip")
                .addHeader("Content-Type", "application/xml")
                .addBody(compress)
                .executeAsString();

重现步骤(如果有请写完整)

使用 POST 方式 发送 byte[] 数据,会进行二次处理请求体,导致服务端接收到的 byte[] 有问题,服务端无法进行处理 byte[] 数据

报错信息/完整请求日志(如果没有请求日志请把开关打开)

	POST http://localhost:8080/api/v1/yidam/receive HTTP
	Headers: 
		Content-Type: application/xml
		Content-Encoding: gzip
	Body: com.dtflys.forest.http.body.ByteArrayRequestBody@169f4152

接口定义(必要时请提供)

Comments (0)

dongxing created任务

Sign in to comment

Status
Assignees
Milestones
Pull Requests
Successfully merging a pull request will close this issue.
Branches
Planed to start   -   Planed to end
-
Top level
Priority
参与者(1)
Java
1
https://gitee.com/dromara/forest.git
git@gitee.com:dromara/forest.git
dromara
forest
forest

Search

53164aa7 5694891 3bd8fe86 5694891