test[http]: http server的使用示例

This commit is contained in:
godotg
2022-09-28 15:52:31 +08:00
parent 67a7279f58
commit 9c79ef74db
@@ -48,7 +48,7 @@ public class HttpServerTest {
public DecodedPacketInfo apply(FullHttpRequest fullHttpRequest) {
var uri = StringUtils.trim(fullHttpRequest.uri());
if (uri.equals("/hello")) {
return DecodedPacketInfo.valueOf(HttpHelloRequest.valueOf("aaa"), HttpAttachment.valueOf(fullHttpRequest, null));
return DecodedPacketInfo.valueOf(HttpHelloRequest.valueOf("other param"), HttpAttachment.valueOf(fullHttpRequest, null));
} else {
throw new RunException("未知的http路径[{}]", uri);
}