REST 增加 @RestBody 特性, 获取请求内容, 参数可以是String 或 byte[]
This commit is contained in:
@@ -282,6 +282,15 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
return array.toString(UTF8);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取请求内容的byte[]
|
||||
*
|
||||
* @return 内容
|
||||
*/
|
||||
public byte[] getBody() {
|
||||
return array.getBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* 直接获取body对象
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user