| CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Wed, 24 Dec 2025 01:54:54 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20100704113207
location: https://web.archive.org/web/20100704113207/https://github.com/technoweenie/faraday
server-timing: captures_list;dur=0.924632, exclusion.robots;dur=0.076482, exclusion.robots.policy;dur=0.060332, esindex;dur=0.014316, cdx.remote;dur=7.099606, LoadShardBlock;dur=176.430983, PetaboxLoader3.datanode;dur=87.397273, PetaboxLoader3.resolve;dur=49.021813
x-app-server: wwwb-app218-dc8
x-ts: 302
x-tr: 220
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app218; path=/
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Wed, 24 Dec 2025 01:54:55 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.7.61
x-archive-orig-date: Sun, 04 Jul 2010 11:32:06 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-etag: "8c482b322321b449f207392b097de3eb"
x-archive-orig-x-runtime: 77ms
x-archive-orig-content-length: 27106
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Sun, 04 Jul 2010 11:32:07 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_16_20100704092246_crawl103-c/52_16_20100704113016_crawl101.arc.gz
server-timing: captures_list;dur=0.566184, exclusion.robots;dur=0.020689, exclusion.robots.policy;dur=0.009278, esindex;dur=0.011725, cdx.remote;dur=44.639488, LoadShardBlock;dur=163.929798, PetaboxLoader3.datanode;dur=163.166781, PetaboxLoader3.resolve;dur=301.443538, load_resource;dur=346.959871
x-app-server: wwwb-app218-dc8
x-ts: 200
x-tr: 614
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
technoweenie's faraday at master - GitHub
technoweenie / faraday
- Source
- Commits
- Network (6)
- Issues (1)
- Downloads (4)
- Wiki (1)
- Graphs
-
Branch:
master
click here to add a description
click here to add a homepage
faraday /
| name | age | message | |
|---|---|---|---|
| |
.document | Thu Dec 10 04:43:53 -0800 2009 | Initial commit to faraday. [technoweenie] |
| |
.gitignore | Thu Dec 10 04:43:53 -0800 2009 | Initial commit to faraday. [technoweenie] |
| |
LICENSE | Tue Jan 12 17:03:34 -0800 2010 | rename Alice => Faraday. [technoweenie] |
| |
README.rdoc | Sun May 30 13:00:10 -0700 2010 | better :header_name => "Header-Name" conversion [technoweenie] |
| |
Rakefile | Wed May 05 23:23:28 -0700 2010 | merge gemspec edits [technoweenie] |
| |
VERSION | Fri May 28 19:44:17 -0700 2010 | Version bump to 0.4.6 [technoweenie] |
| |
faraday.gemspec | Fri May 28 19:44:29 -0700 2010 | bump [technoweenie] |
| |
lib/ | Mon Jun 07 08:43:13 -0700 2010 | add rough ActionDispatch adapter for testing Ra... [technoweenie] |
| |
test/ | Tue May 04 11:29:00 -0700 2010 | Depend on rack >= 1.0.1 to be compatible with a... [jferris] |
README.rdoc
faraday
Modular HTTP client library using middleware heavily inspired by Rack.
This mess is gonna get raw, like sushi. So, haters to the left.
Usage
conn = Faraday::Connection.new(:url => 'https://sushi.com') do |builder|
builder.use Faraday::Request::Yajl # convert body to json with Yajl lib
builder.use Faraday::Adapter::Logger # log the request somewhere?
builder.use Faraday::Adapter::Typhoeus # make http request with typhoeus
builder.use Faraday::Response::Yajl # # parse body with yajl
# or use shortcuts
builder.request :yajl # Faraday::Request::Yajl
builder.adapter :logger # Faraday::Adapter::Logger
builder.adapter :typhoeus # Faraday::Adapter::Typhoeus
builder.response :yajl # Faraday::Response::Yajl
end
resp1 = conn.get '/nigiri/sake.json'
resp2 = conn.post do |req|
req.url "/nigiri.json", :page => 2
req[:content_type] = 'application/json'
req.body = {:name => 'Unagi'}
end
# If you're ready to roll with just the bare minimum (net/http):
resp1 = Faraday.get 'https://sushi.com/nigiri/sake.json'
Testing
# It's possible to define stubbed request outside a test adapter block.
stubs = Faraday::Test::Stubs.new do |stub|
stub.get('/tamago') { [200, {}, 'egg'] }
end
# You can pass stubbed request to the test adapter or define them in a block
# or a combination of the two.
test = Faraday::Connection.new do |builder|
builder.adapter :test, stubs do |stub|
stub.get('/ebi') {[ 200, {}, 'shrimp' ]}
end
end
# It's also possible to stub additional requests after the connection has
# been initialized. This is useful for testing.
stubs.get('/uni') {[ 200, {}, 'urchin' ]}
resp = test.get '/tamago'
resp.body # => 'egg'
resp = test.get '/ebi'
resp.body # => 'shrimp'
resp = test.get '/uni'
resp.body # => 'urchin'
resp = test.get '/else' #=> raises "no such stub" error
# If you like, you can treat your stubs as mocks by verifying that all of
# the stubbed calls were made. NOTE that this feature is still fairly
# experimental: It will not verify the order or count of any stub, only that
# it was called once during the course of the test.
stubs.verify_stubbed_calls
TODO
- support streaming requests/responses
- better stubbing API
- Support timeouts
- Add curb, em-http, fast_http
Note on Patches/Pull Requests
- Fork the project.
- Make your feature addition or bug fix.
- Add tests for it. This is important so I don’t break it in a future version unintentionally.
- Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
- Send me a pull request. Bonus points for topic branches.
Copyright
Copyright © 2009-2010 rick, hobson. See LICENSE for details.

