Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
using Faraday with EM-Synchrony & EM-Http
require 'faraday'
require 'net/http'
require 'pp'
# Repos:
# https://github.com/technoweenie/faraday
# https://github.com/pengwynn/faraday_middleware
# Blog posts:
# http://adventuresincoding.com/2010/09/writing-modular-http-client-code-with-faraday
# http://wynnnetherland.com/projects/faraday-middleware
conn = Faraday::Connection.new(:url => 'http://api.postrank.com') do |builder|
builder.use Faraday::Adapter::EMSynchrony # make http request with eventmachine and synchrony
builder.use Faraday::Response::Yajl # parse body with yajl
end
resp = conn.get do |req|
req.url "/v2/feed/info?appkey=demokey&format=json&id=igvita.com"
end
pp resp
puts
# Set EM-Synchrony to be default drive + parse JSON responses
Faraday.default_connection = Faraday::Connection.new do |builder|
builder.use Faraday::Adapter::EMSynchrony
builder.use Faraday::Response::Yajl
end
resp = Faraday.get "http://api.postrank.com/v2/feed/info?appkey=demokey&format=json&id=igvita.com"
pp resp
@adamrobbie

If using nokogiri would setting the content type to xml and using a post request with your xml document be sufficient to get this working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.