Skip to content

rogerleite/http_monkey-cookie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

About

Support to cookies on http_monkey

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages