本文整理匯總了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"));
}