HttpCookie.TeslaMiddleware (http_cookie v0.9.0)
View SourceTesla middleware to automatically manage cookies using http_cookie.
Make sure to list the middleware after any redirect handling middleware like Tesla.Middleware.FollowRedirects to ensure the cookie handling code is called before/after every redirect.
Options
:jar_server
- HttpCookie.Jar.Server instance pid (required)
Examples
server_pid = HttpCookie.Jar.Server.start_link([])
client = Tesla.client([{HttpCookie.TeslaMiddleware, jar_server: server_pid}])