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