Faraday middleware for managing cookies
Add this line to your application's Gemfile:
gem 'faraday_middleware-cookiejar', :git => 'git://github.com/eagletmt/faraday_middleware-cookiejar.git'
And then execute:
$ bundle
require 'faraday'
require 'faraday_middleware/cookiejar'
conn = Faraday::Connection.new do |builder|
builder.url_prefix = 'http://www.example.com/'
builder.use Faraday::Request::UrlEncoded
builder.use FaradayMiddleware::CookieJar
builder.adapter Faraday.default_adapter
end
conn.post '/login', { :username => 'eagletmt', :password => 'PASSWORD' }
conn.get '/'
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request