mirror of
https://gitee.com/dromara/hutool.git
synced 2025-05-06 05:38:00 +08:00
fix: 1.HttpResponse增加设置bodyBytes储存主体方法(修复使用HttpResponse拦截器解密无法重新设置bodyBytes主体)
This commit is contained in:
parent
6f1a8d4214
commit
f5318c6dad
@ -255,6 +255,21 @@ public class HttpResponse extends HttpBase<HttpResponse> implements Closeable {
|
||||
return this.bodyBytes;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置主体字节码<br>
|
||||
* 需在此方法调用前使用charset方法设置编码,否则使用默认编码UTF-8
|
||||
*
|
||||
* @param bodyBytes 主体
|
||||
* @return this
|
||||
*/
|
||||
public HttpResponse body(byte[] bodyBytes) {
|
||||
sync();
|
||||
if (null != bodyBytes) {
|
||||
this.bodyBytes = bodyBytes;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取响应主体
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user