本文整理汇总了Java中javax.ws.rs.core.Response.noContent方法的典型用法代码示例。如果您正苦于以下问题:Java Response.noContent方法的具体用法?Java Response.noContent怎么用?Java Response.noContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.ws.rs.core.Response
的用法示例。
在下文中一共展示了Response.noContent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteCollectionItem
import javax.ws.rs.core.Response; //导入方法依赖的package包/类
@Override
public Response deleteCollectionItem(String name, String id) {
Try<ItemRoutes<Object>> itemRoutesTry = _getItemRoutesTry(name);
itemRoutesTry.map(
ItemRoutes::getDeleteConsumerOptional
).map(
Optional::get
).mapFailMatching(
NoSuchElementException.class,
_getNotAllowedExceptionSupplier("DELETE", name + "/" + id)
).getUnchecked(
).apply(
_httpServletRequest
).accept(
new Path(name, id)
);
ResponseBuilder responseBuilder = Response.noContent();
return responseBuilder.build();
}
示例2: buildCookieResponseNoHash
import javax.ws.rs.core.Response; //导入方法依赖的package包/类
@Test
public void buildCookieResponseNoHash() {
final ResponseBuilder rb = Response.noContent();
resource.accept(rb, new UsernamePasswordAuthenticationToken("any", "n/a"));
final Response response = rb.build();
Assert.assertNull(response.getCookies().get(RedirectResource.PREFERRED_COOKIE_HASH));
Assert.assertNull(response.getHeaderString("location"));
}
示例3: buildCookieResponse
import javax.ws.rs.core.Response; //导入方法依赖的package包/类
@Test
public void buildCookieResponse() {
final SystemUserSetting setting = new SystemUserSetting();
setting.setLogin(DEFAULT_USER);
setting.setName(RedirectResource.PREFERRED_HASH);
setting.setValue("hash");
userSettingRepository.save(setting);
final ResponseBuilder rb = Response.noContent();
resource.accept(rb, new UsernamePasswordAuthenticationToken(DEFAULT_USER, "n/a"));
final Response response = rb.build();
Assert.assertEquals("junit|hash", response.getCookies().get(RedirectResource.PREFERRED_COOKIE_HASH).getValue());
Assert.assertNull(response.getHeaderString("location"));
}