mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -204,4 +204,10 @@ public class HttpRequestTest {
|
||||
final HttpRequest httpRequest = new HttpRequest(urlBuilder);
|
||||
httpRequest.setMethod(Method.GET).execute();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void getCookieTest(){
|
||||
HttpRequest.get("http://localhost:8888/getCookier").execute();
|
||||
}
|
||||
}
|
||||
|
@@ -1,12 +1,16 @@
|
||||
package cn.hutool.http.server;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.core.net.multipart.UploadFile;
|
||||
import cn.hutool.http.ContentType;
|
||||
import cn.hutool.http.Header;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
|
||||
import java.net.HttpCookie;
|
||||
|
||||
public class SimpleServerTest {
|
||||
|
||||
public static void main(final String[] args) {
|
||||
@@ -54,7 +58,13 @@ public class SimpleServerTest {
|
||||
.addAction("test/zeroStr", (req, res)-> {
|
||||
res.write("0");
|
||||
Console.log("Write 0 OK");
|
||||
})
|
||||
}).addAction("/getCookie", ((request, response) -> {
|
||||
response.setHeader(Header.SET_COOKIE.toString(),
|
||||
ListUtil.of(
|
||||
new HttpCookie("cc", "123").toString(),
|
||||
new HttpCookie("cc", "abc").toString()));
|
||||
response.write("Cookie ok");
|
||||
}))
|
||||
.start();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user