我想向webclient添加一个cookie,这段代码在GAE之外按预期工作:
WebClient webClient = new WebClient(CHROME);
webClient.addCookie("storepath=us/en", new URL("http://www.zara.com/"), null);
但是在GAE上它会抛出:
java.lang.IllegalArgumentException: Port may not be negative
at org.apache.http.util.Args.notNegative(Args.java:115)
at org.apache.http.cookie.CookieOrigin.<init>(CookieOrigin.java:52)
at com.gargoylesoftware.htmlunit.CookieManager.buildCookieOrigin(CookieManager.java:102)
at com.gargoylesoftware.htmlunit.WebClient.addCookie(WebClient.java:2258)
如何在GAE上添加此Cookie?