本文整理了Java中io.vertx.ext.web.Router.deleteWithRegex
方法的一些代码示例,展示了Router.deleteWithRegex
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Router.deleteWithRegex
方法的具体详情如下:
包路径:io.vertx.ext.web.Router
类名称:Router
方法名:deleteWithRegex
[英]Add a route that matches a HTTP DELETE request and the specified path regex
[中]
代码示例来源:origin: org.zalando/vertx-swagger
@Override
public Route deleteWithRegex(String regex) {
return router.deleteWithRegex(regex);
}
代码示例来源:origin: vert-x3/vertx-web
@Test
public void testDeleteWithRegex() throws Exception {
router.deleteWithRegex("\\/somepath\\/.*").handler(rc -> rc.response().setStatusMessage("foo").end());
testRequest(HttpMethod.DELETE, "/somepath/whatever", 200, "foo");
testRequest(HttpMethod.DELETE, "/otherpath/whatever", 404, "Not Found");
testRequest(HttpMethod.GET, "/somepath/whatever", 404, "Not Found");
testRequest(HttpMethod.POST, "/somepath/whatever", 404, "Not Found");
testRequest(HttpMethod.PUT, "/somepath/whatever", 404, "Not Found");
testRequest(HttpMethod.OPTIONS, "/somepath/whatever", 404, "Not Found");
testRequest(HttpMethod.HEAD, "/somepath/whatever", 404, "Not Found");
}
代码示例来源:origin: vert-x3/vertx-rx
/**
* Add a route that matches a HTTP DELETE request and the specified path regex
* @param regex URI paths that begin with a match for this regex will match
* @return the route
*/
public io.vertx.rxjava.ext.web.Route deleteWithRegex(String regex) {
io.vertx.rxjava.ext.web.Route ret = io.vertx.rxjava.ext.web.Route.newInstance(delegate.deleteWithRegex(regex));
return ret;
}
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* Add a route that matches a HTTP DELETE request and the specified path regex
* @param regex URI paths that begin with a match for this regex will match
* @return the route
*/
public io.vertx.rxjava.ext.web.Route deleteWithRegex(String regex) {
io.vertx.rxjava.ext.web.Route ret = io.vertx.rxjava.ext.web.Route.newInstance(delegate.deleteWithRegex(regex));
return ret;
}
代码示例来源:origin: wang007/vertx-start
@Override
public io.vertx.ext.web.Route deleteWithRegex(String regex) {
return delegate.deleteWithRegex(getFullPath(regex));
}
代码示例来源:origin: org.swisspush.gateleen/gateleen-routing
private void installMethodForwarder(io.vertx.ext.web.Router newRouter, Rule rule, Handler<RoutingContext> forwarder) {
for (String method : rule.getMethods()) {
log.info("Installing " + rule.getScheme().toUpperCase() + " forwarder for methods " + method + " to " + rule.getUrlPattern());
switch (method) {
case "GET":
newRouter.getWithRegex(rule.getUrlPattern()).handler(forwarder);
break;
case "PUT":
newRouter.putWithRegex(rule.getUrlPattern()).handler(forwarder);
break;
case "POST":
newRouter.postWithRegex(rule.getUrlPattern()).handler(forwarder);
break;
case "DELETE":
newRouter.deleteWithRegex(rule.getUrlPattern()).handler(forwarder);
break;
}
}
}
代码示例来源:origin: io.vertx/vertx-web
@Test
public void testDeleteWithRegex() throws Exception {
router.deleteWithRegex("\\/somepath\\/.*").handler(rc -> rc.response().setStatusMessage("foo").end());
testRequest(HttpMethod.DELETE, "/somepath/whatever", 200, "foo");
testRequest(HttpMethod.DELETE, "/otherpath/whatever", 404, "Not Found");
testRequest(HttpMethod.GET, "/somepath/whatever", 404, "Not Found");
testRequest(HttpMethod.POST, "/somepath/whatever", 404, "Not Found");
testRequest(HttpMethod.PUT, "/somepath/whatever", 404, "Not Found");
testRequest(HttpMethod.OPTIONS, "/somepath/whatever", 404, "Not Found");
testRequest(HttpMethod.HEAD, "/somepath/whatever", 404, "Not Found");
}
代码示例来源:origin: org.swisspush/redisques
router.deleteWithRegex(prefix + "/queues/[^/]+").handler(this::deleteAllQueueItems);
router.deleteWithRegex(prefix + "/queues/([^/]+)/[0-9]+").handler(this::deleteQueueItem);
router.deleteWithRegex(prefix + "/locks/[^/]+").handler(this::deleteSingleLock);
代码示例来源:origin: org.swisspush.gateleen/gateleen-queue
router.deleteWithRegex(prefix + "/queues/[^/]+").handler(ctx -> {
final String queue = lastPart(ctx.request().path(), "/");
eb.send(redisquesAddress, buildDeleteAllQueueItemsOperation(queue), reply -> {
router.deleteWithRegex(prefix + "/queues/([^/]+)/[0-9]+").handler(ctx -> {
final String queue = part(ctx.request().path(), "/", 2);
final int index = Integer.parseInt(lastPart(ctx.request().path(), "/"));
router.deleteWithRegex(prefix + "/locks/[^/]+").handler(ctx -> {
String queue = lastPart(ctx.request().path(), "/");
eb.send(redisquesAddress, buildDeleteLockOperation(queue), new Handler<AsyncResult<Message<JsonObject>>>() {
代码示例来源:origin: org.swisspush/gateleen-queue
router.deleteWithRegex(prefix + "/queues/[^/]+").handler(ctx -> {
final String queue = lastPart(ctx.request().path(), "/");
eb.send(redisquesAddress, buildDeleteAllQueueItemsOperation(queue), reply -> {
router.deleteWithRegex(prefix + "/queues/([^/]+)/[0-9]+").handler(ctx -> {
final String queue = part(ctx.request().path(), "/", 2);
final int index = Integer.parseInt(lastPart(ctx.request().path(), "/"));
router.deleteWithRegex(prefix + "/locks/[^/]+").handler(ctx -> {
String queue = lastPart(ctx.request().path(), "/");
eb.send(redisquesAddress, buildDeleteLockOperation(queue), new Handler<AsyncResult<Message<JsonObject>>>() {
内容来源于网络,如有侵权,请联系作者删除!