0.01
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
A fluent interface to do HTTP calls, free of fat dependencies and at same time, powered by middlewares rack.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 2.0.0
~> 0.0.4
>= 0
 Project Readme

[Mini logo] Build Status

HTTP Monkey

A fluent interface to do HTTP calls, free of fat dependencies and at same time, powered by middlewares rack.

  • Light and powerful interface
  • Flexibility
  • Choose your HTTP adapter
  • Middlewares (More power to the people!)
  • Easy to contribute

Installation

Add this line to your application's Gemfile:

gem 'http_monkey'

And then execute:

$ bundle

Or install it yourself as:

$ gem install http_monkey

Usage

HTTP Monkey home.

Some code to make developers happy!

  agent = HttpMonkey.build

  # you can set headers, cookies, auth, proxy timeout, SSL ... all web stuff.
  # response = agent.at("http://someservice.com").
  #              with_header("Content-Type" => "application/json").
  #              basic_auth("user", "pass").
  #              get

  response = agent.at("http://google.com").get
  puts response.code  # response.headers and response.body

  # you can change settings on your client
  agent.configure do
    middlewares do
    # Default HTTP Headers (to all requests)
    use HttpMonkey::M::DefaultHeaders, {"Content-Type" => "application/json"}

    # Filter ALL requests (access to env and request objects)
    middlewares.use HttpMonkey::M::RequestFilter do |env, request|
      # HTTPI::Request, you can set proxy, timeouts, authentication etc.
      # req.proxy = "http://proxy.com"
    end

    # Enable automatic follow redirect
    middlewares.use HttpMonkey::M::FollowRedirect, :max_tries => 3
  end

  # or settings by request
  response = agent.at("http://google.com").get do
    net_adapter :curb # [:httpclient, :curb, :net_http, :em_http]
    behaviours do
      on([301, 302]) do |client, request, response|
        raise "Redirect Error"
      end
    end
  end

Development

Suggestions, bugs and pull requests, use GitHub Issues. See CONTRIBUTING for more details.

To see what has changed in recent versions of HTTP Monkey, see the CHANGELOG.

Core Team Members

Copyright

Copyright © 2012 HTTP Monkey. See LICENSE for details.

Project is a member of the OSS Manifesto.

Bitdeli Badge