我正在尝试从 AppEngine Endpoints 方法中读取 HTTP Cookie:
@ApiMethod(httpMethod = "get")
public void getAll(HttpServletRequest req) {
log.info("req: " + req);
Cookie[] cookies = req.getCookies();
for (Cookie cookie : cookies) {
log.info("cookie: " + cookie.getName() + " " + cookie.getValue());
}
}
但无论我尝试什么,cookie 都是 NULL。有任何想法吗?它应该以这种方式工作:http ://chirashi.zenconsult.net/2013/07/custom-authentication-with-google-cloud-endpoints-using-app-engine-java