本文整理了Java中io.vertx.ext.web.Router.headWithRegex
方法的一些代码示例,展示了Router.headWithRegex
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Router.headWithRegex
方法的具体详情如下:
包路径:io.vertx.ext.web.Router
类名称:Router
方法名:headWithRegex
[英]Add a route that matches a HTTP HEAD request and the specified path regex
[中]添加与HTTP头请求和指定路径regex匹配的路由
代码示例来源:origin: org.zalando/vertx-swagger
@Override
public Route headWithRegex(String regex) {
return router.headWithRegex(regex);
}
代码示例来源:origin: vert-x3/vertx-web
@Test
public void testHeadWithRegex() throws Exception {
router.headWithRegex("\\/somepath\\/.*").handler(rc -> rc.response().setStatusMessage("foo").end());
testRequest(HttpMethod.HEAD, "/somepath/whatever", 200, "foo");
testRequest(HttpMethod.HEAD, "/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.DELETE, "/somepath/whatever", 404, "Not Found");
}
代码示例来源:origin: vert-x3/vertx-rx
/**
* Add a route that matches a HTTP HEAD 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 headWithRegex(String regex) {
io.vertx.rxjava.ext.web.Route ret = io.vertx.rxjava.ext.web.Route.newInstance(delegate.headWithRegex(regex));
return ret;
}
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* Add a route that matches a HTTP HEAD 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 headWithRegex(String regex) {
io.vertx.rxjava.ext.web.Route ret = io.vertx.rxjava.ext.web.Route.newInstance(delegate.headWithRegex(regex));
return ret;
}
代码示例来源:origin: wang007/vertx-start
@Override
public io.vertx.ext.web.Route headWithRegex(String regex) {
return delegate.headWithRegex(getFullPath(regex));
}
代码示例来源:origin: io.vertx/vertx-web
@Test
public void testHeadWithRegex() throws Exception {
router.headWithRegex("\\/somepath\\/.*").handler(rc -> rc.response().setStatusMessage("foo").end());
testRequest(HttpMethod.HEAD, "/somepath/whatever", 200, "foo");
testRequest(HttpMethod.HEAD, "/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.DELETE, "/somepath/whatever", 404, "Not Found");
}
内容来源于网络,如有侵权,请联系作者删除!