发表更新2 分钟读完 (大约295个字)
响应json, 需要安装jackson
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.13.4</version> </dependency>
router .get("/some/path") .respond( ctx -> Future.succeededFuture(new Pojo()));
或者 ctx.json(new Todo());
|
阅读更多