http - 在 scalaj-http 中使用 cookie

标签 http scala cookies

我选择最简单的库来处理 http https://github.com/scalaj/scalaj-http但是,在其文档中有关于使用 cookie 的信息。

我该怎么做?

最佳答案

库中没有 cookie 处理。如果您想使用 scalaj-http 处理 cookie,您需要自己解析和生成 CookieSet-Cookie header 。

其他图书馆如Dispatch确实有 getting and setting cookies 的方法,尽管您可能仍然需要在请求之间维护自己的 cookie 存储。如果您不介意使用不是专门为 Scala 编写的库,Apache HttpComponents确实有很好的 cookie 支持,并且可以跨请求维护 cookie。

关于http - 在 scalaj-http 中使用 cookie,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19208947/

相关文章:

C 中的 CGI : Page Redirect

scala - 被 FoldLeft 错误困惑(在 Eclipse 和 REPL 中)

string - 如何在scala中将长十六进制字符串转换为BigInt

javascript - 在没有eval()的情况下在javascript中将字符串转换为数组

python - Cookie 未保存在浏览器中

HTTP 流水线 - 每个连接的并发响应

http - 在 Simperium 中创建每个用户的管理员 key

javascript - 查询参数作为 javascript 函数添加到 HTTP

scala - 如何从 TypeClass 解析中排除特定类型?

ruby-on-rails - 测试 Rails 中 cookie 值的清除?