!642 HttpBase增加获取bodyBytes储存主体方法

Merge pull request !642 from huang/v5-dev
This commit is contained in:
Looly 2022-06-08 01:59:55 +00:00 committed by Gitee
commit 7f69a03dd0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 10 additions and 0 deletions

View File

@ -297,6 +297,15 @@ public abstract class HttpBase<T> {
return (T) this;
}
/**
* 获取bodyBytes存储字节码
*
* @return byte[]
*/
public byte[] bodyBytes() {
return this.bodyBytes;
}
/**
* 返回字符集
*

View File

@ -249,6 +249,7 @@ public class HttpResponse extends HttpBase<HttpResponse> implements Closeable {
*
* @return byte[]
*/
@Override
public byte[] bodyBytes() {
sync();
return this.bodyBytes;