mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add methods
This commit is contained in:
@@ -395,6 +395,21 @@ public class HttpResponse extends HttpBase<HttpResponse> implements Closeable {
|
||||
public long writeBody(final String targetFileOrDir) {
|
||||
return writeBody(FileUtil.file(targetFileOrDir));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置主体字节码,一版用于拦截器修改响应内容<br>
|
||||
* 需在此方法调用前使用charset方法设置编码,否则使用默认编码UTF-8
|
||||
*
|
||||
* @param bodyBytes 主体
|
||||
* @return this
|
||||
*/
|
||||
public HttpResponse body(final byte[] bodyBytes) {
|
||||
sync();
|
||||
if (null != bodyBytes) {
|
||||
this.bodyBytes = bodyBytes;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
// ---------------------------------------------------------------- Body end
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user