本文整理了Java中org.apache.cxf.jaxrs.client.WebClient.delete()
方法的一些代码示例,展示了WebClient.delete()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebClient.delete()
方法的具体详情如下:
包路径:org.apache.cxf.jaxrs.client.WebClient
类名称:WebClient
方法名:delete
[英]Does HTTP DELETE invocation
[中]HTTP删除调用吗
代码示例来源:origin: Talend/tesb-rt-se
private void unregisterEndpointExample(String service, String endpoint)
throws UnsupportedEncodingException {
System.out.println("------------------------------");
System.out.println("Unregister endpoint");
System.out.println("ServiceName: ".concat(service));
System.out.println("EndpointURL: ".concat(endpoint));
WebClient wc = WebClient.create(BASE_ADDRESS.concat("/")
.concat(URLEncoder.encode(service, "UTF-8")).concat("/")
.concat(URLEncoder.encode(endpoint, "UTF-8")));
try {
wc.delete();
} catch (WebApplicationException ex) {
System.err.println(ex.getResponse().getStatus() + ": "
+ ex.getMessage());
}
}
代码示例来源:origin: com.redhat.rhevm.api/rhevm-api-cli-base
public void doRemove(BaseResource resource) throws Exception {
Response r = null;
Exception failure = null;
try {
WebClient delete = getClient(resource.getHref());
r = delete.path("/").delete();
} catch (Exception e) {
failure = e;
}
int expectedStatus = 204;
if (failure != null || r.getStatus() != expectedStatus) {
diagnose("remove failed with ", failure, r, expectedStatus);
} else {
System.out.println("remove succeeded");
}
}
代码示例来源:origin: apache/cxf
@Before
public void setUp() {
final Response r = createWebClient("/bookstore/books").delete();
assertEquals(Status.OK.getStatusCode(), r.getStatus());
}
代码示例来源:origin: apache/cxf
@Before
public void setUp() {
final Response r = createWebClient("/bookstore/books").delete();
assertEquals(Status.OK.getStatusCode(), r.getStatus());
}
代码示例来源:origin: apache/cxf
@Before
public void setUp() {
createWebClient("/catalog").delete();
}
代码示例来源:origin: Talend/tesb-rt-se
System.out.println("Removing member with ID of " + maxID);
resp = wc.path("all").path(new Integer(maxID).toString()).delete();
代码示例来源:origin: Talend/tesb-rt-se
client.delete();
} catch (NotFoundException e) {
return;
代码示例来源:origin: org.talend.esb.auxiliary.storage/auxiliary-storage-client-rest
client.delete();
} catch (NotFoundException e) {
return;
代码示例来源:origin: apache/cxf
@org.junit.Test
public void testRegisterClientInitialAccessTokenCodeGrant() throws Exception {
URL busFile = OIDCDynamicRegistrationTest.class.getResource("client.xml");
String address = "https://localhost:" + PORT + "/services/dynamicWithAt/register";
WebClient wc = WebClient.create(address, Collections.singletonList(new JsonMapObjectProvider()),
busFile.toString());
wc.accept("application/json").type("application/json");
ClientRegistration reg = newClientRegistrationCodeGrant();
ClientRegistrationResponse resp = null;
assertEquals(401, wc.post(reg).getStatus());
wc.authorization(new ClientAccessToken("Bearer", "123456789"));
resp = wc.post(reg, ClientRegistrationResponse.class);
assertNotNull(resp.getClientId());
assertNotNull(resp.getClientSecret());
assertEquals(address + "/" + resp.getClientId(),
resp.getRegistrationClientUri());
String regAccessToken = resp.getRegistrationAccessToken();
assertNotNull(regAccessToken);
wc.reset();
wc.path(resp.getClientId());
assertEquals(401, wc.get().getStatus());
wc.authorization(new ClientAccessToken("Bearer", regAccessToken));
ClientRegistration clientRegResp = wc.get(ClientRegistration.class);
testCommonRegCodeGrantProperties(clientRegResp);
assertNull(clientRegResp.getTokenEndpointAuthMethod());
assertEquals(200, wc.delete().getStatus());
}
代码示例来源:origin: apache/cxf
@Test
public void testRegisterClientTwoWayTLSClientIdBoundDynReg() throws Exception {
String dynRegAddress = "https://localhost:" + PORT + "/oauth2Jwt/register";
WebClient wcDynReg = createDynRegWebClient(dynRegAddress);
wcDynReg.accept("application/json").type("application/json");
ClientRegistration reg = newClientRegistration();
wcDynReg.authorization(new ClientAccessToken("Bearer", "123456789"));
ClientRegistrationResponse resp = wcDynReg.post(reg, ClientRegistrationResponse.class);
doTestTwoWayTLSClientIdBoundJwt(resp.getClientId());
// delete the client
String regAccessToken = resp.getRegistrationAccessToken();
assertNotNull(regAccessToken);
wcDynReg.path(resp.getClientId());
wcDynReg.authorization(new ClientAccessToken("Bearer", regAccessToken));
assertEquals(200, wcDynReg.delete().getStatus());
assertNotNull(regAccessToken);
}
代码示例来源:origin: apache/cxf
clientRegResp.getProperty(OAuthConstants.TLS_CLIENT_AUTH_SUBJECT_DN));
assertEquals(200, wc.delete().getStatus());
代码示例来源:origin: apache/cxf
assertNull(clientRegResp.getRedirectUris());
assertEquals(200, wc.delete().getStatus());
代码示例来源:origin: apache/cxf
assertNull(clientRegResp.getRedirectUris());
assertEquals(200, wc.delete().getStatus());
内容来源于网络,如有侵权,请联系作者删除!