Skip to content
Support to cookies on http_monkey
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
.gitignore
Gemfile
LICENSE.txt
README.md
Rakefile
http_monkey-cookie.gemspec

README.md

HttpMonkey::Cookie

Rack middleware to use with HttpMonkey and support magic cookies on your requests.

TOC:

Installation

Add this line to your application's Gemfile:

gem 'http_monkey-cookie'

And then execute:

$ bundle

Or install it yourself as:

$ gem install http_monkey-cookie

Usage

require "http_monkey"
require "http_monkey/cookie"

HttpMonkey.configure do
  # Default HTTP Headers (to all requests)
  middlewares.use HttpMonkey::M::Cookie
end

response = HttpMonkey.at("http://domain.com").get
# Returns Set-Cookie: token=magic;Version=1;Comment=;Domain=.domain.com;Path=/;Max-Age=999999999;httpOnly

HttpMonkey.at("http://domain.com/service").get
# Uses Cookie: token=magic etc.

HttpMonkey.at("http://example.com").get
# Don't send cookies

Notes

This version is experimental and can explode in any moment.

Some resources to build a new cookie project:

Something went wrong with that request. Please try again.