本文整理了Java中org.jooby.Request.body
方法的一些代码示例,展示了Request.body
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.body
方法的具体详情如下:
包路径:org.jooby.Request
类名称:Request
方法名:body
[英]Short version of body().to(type)
. HTTP body. Please don't use this method for form submits. This method is used for getting raw
or a parsed data like json, xml, etc...
[中][$0$]的短版本。HTTP正文。请不要将此方法用于表单提交。此方法用于获取raw
或json、xml等解析数据。。。
代码示例来源:origin: jooby-project/jooby
@Override
public <T> T body(final Class<T> type) throws Exception {
return req.body(type);
}
代码示例来源:origin: jooby-project/jooby
@Override
public Mutant body() throws Exception {
return req.body();
}
代码示例来源:origin: jooby-project/jooby
/**
* Short version of <code>body().to(type)</code>.
*
* HTTP body. Please don't use this method for form submits. This method is used for getting
* <code>raw</code> or a parsed data like json, xml, etc...
*
* @param type Object type.
* @param <T> Value type.
* @return Instance of object.
* @throws Exception If body can't be converted or there is no HTTP body.
*/
@Nonnull
default <T> T body(final Class<T> type) throws Exception {
return body().to(type);
}
代码示例来源:origin: jooby-project/jooby
@Override public String getRequestContent() {
return Try.apply(() -> req.body().value()).get();
}
代码示例来源:origin: org.jooby/jooby
@Override
public <T> T body(final Class<T> type) throws Exception {
return req.body(type);
}
代码示例来源:origin: org.jooby/jooby
@Override
public Mutant body() throws Exception {
return req.body();
}
代码示例来源:origin: org.jooby/jooby
/**
* Short version of <code>body().to(type)</code>.
*
* HTTP body. Please don't use this method for form submits. This method is used for getting
* <code>raw</code> or a parsed data like json, xml, etc...
*
* @param type Object type.
* @param <T> Value type.
* @return Instance of object.
* @throws Exception If body can't be converted or there is no HTTP body.
*/
@Nonnull
default <T> T body(final Class<T> type) throws Exception {
return body().to(type);
}
内容来源于网络,如有侵权,请联系作者删除!