REST 增加 @RestBody 特性, 获取请求内容, 参数可以是String 或 byte[]

This commit is contained in:
Redkale
2017-05-10 23:35:47 +08:00
parent 6daa45ff05
commit 6676c3fd37
6 changed files with 103 additions and 4 deletions

View File

@@ -282,6 +282,15 @@ public class HttpRequest extends Request<HttpContext> {
return array.toString(UTF8);
}
/**
* 获取请求内容的byte[]
*
* @return 内容
*/
public byte[] getBody() {
return array.getBytes();
}
/**
* 直接获取body对象
*