Skip to content


MIT 24 19 1,152
2.7 million (month) Oct 31 2009 0.110.0(24 days ago)
876 4 7 MIT
0.11.0(3 years ago) Sep 25 2013 185.3 thousand (month)

Excon is a Ruby library for making HTTP requests. It is designed to be fast and efficient, and is often used as a building block for other Ruby libraries and frameworks.

One of the main features of Excon is its support for persistent connections, which allows it to reuse the same connection for multiple requests, reducing the overhead of establishing a new connection for each request.

Excon also supports streaming requests and responses, which allows you to read or write data to the server incrementally, without having to load the entire response into memory at once.

Pure Ruby, framework and transport agnostic, implementation of HTTP/2 protocol and HPACK header compression with support for:

  • Binary framing parsing and encoding
  • Stream multiplexing and prioritization
  • Connection and stream flow control
  • Header compression and server push
  • Connection and stream management
  • And more... see API docs

Protocol specifications:

  • Hypertext Transfer Protocol Version 2 (RFC 7540)
  • HPACK: Header Compression for HTTP/2 (RFC 7541)



Example Use

require 'excon'

# GET requests
response = Excon.get('')
puts response.body
puts response.status
puts response.headers

# POST requests
response ='',
  :body => { :title => 'foo', :body => 'bar', :userId => 1 }.to_json,
  :headers => { 'Content-Type' => 'application/json' } )
puts response.body
require 'http/2'

# GET request
client =
response = client.get("")
puts response.body

# POST reuqest
data = { name: "value" }
response ="", data)

Alternatives / Similar