Merge branch 'v5-dev' of gitee.com:dromara/hutool into v5-dev

This commit is contained in:
Looly 2022-06-16 12:24:09 +08:00
commit 6dc6df24dd

View File

@ -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;
}
/**
* 获取响应主体
*