Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 WS 请求中设置 cookie?
val request = WS.url("http://testurl.com/test.pdf")
可能吗?
我正在使用 Play 版本 2.1.1
WS.url(theurl).withHeaders("Cookie" -> "cookiename=cookieval; name2=val2")
您还可以以相同的方式将域和路径添加到 cookie
WS.url("http://url.com").withHeaders("Cookie" -> "cookieName=value; domain=url.com; path=/")