CookieHttpClient
HTTP clinet with cookie suppot.
Installation
Add this line to your application's Gemfile:
gem 'cookie_http_client'
And then execute:
$ bundle
Or install it yourself as:
$ gem install cookie_http_client
Usage
Basic GET/POST request
client = CookieHTTPClient.new("http://goo.gl/IwTffS")
res = client.get #=> Net::HTTPResponse
client.last_uri #=> https://github.com/suzumura-ss/cookie_http_client
client = CookieHTTPClient.new("http://whois.jprs.jp/")
params = {'type'=>'DOM', 'key'=>'amazon.co.jp'}
res = client.post_form(params) #=> Net::HTTPResponse
Hooking redirection
client = CookieHTTPClient.new("http://goo.gl/IwTffS")
res = client.get{|uri|
# `uri` is URI of location-header.
# You can modify uri.
uri
}
Contributing
- Fork it ( http://github.com/
/cookie_http_client/fork ) - 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