Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
using Faraday with EM-Synchrony & EM-Http
require 'faraday'
require 'net/http'
require 'pp'
# Repos:
# Blog posts:
conn = => '') do |builder|
builder.use Faraday::Adapter::EMSynchrony # make http request with eventmachine and synchrony
builder.use Faraday::Response::Yajl # parse body with yajl
resp = conn.get do |req|
req.url "/v2/feed/info?appkey=demokey&format=json&"
pp resp
# Set EM-Synchrony to be default drive + parse JSON responses
Faraday.default_connection = do |builder|
builder.use Faraday::Adapter::EMSynchrony
builder.use Faraday::Response::Yajl
resp = Faraday.get ""
pp resp

This comment has been minimized.

Copy link

adamrobbie commented Jan 1, 2013

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
You can’t perform that action at this time.