org.jooby.Request.body()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(468)

本文整理了Java中org.jooby.Request.body方法的一些代码示例,展示了Request.body的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.body方法的具体详情如下:
包路径:org.jooby.Request
类名称:Request
方法名:body

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);
}

相关文章