Skip to content

Instantly share code, notes, and snippets.

@andyjeffries
Created May 6, 2015 08:32
Show Gist options
  • Save andyjeffries/6077d5fc2f74645a801a to your computer and use it in GitHub Desktop.
Save andyjeffries/6077d5fc2f74645a801a to your computer and use it in GitHub Desktop.
Example ARC for Abel
require "faraday"
class Customer < ActiveRestClient::Base
base_url "http://requestb.in"
ActiveRestClient::Base.faraday_config do |faraday|
faraday.adapter(:net_http)
faraday.options.timeout = 20
faraday.headers['User-Agent'] = "ActiveRestClient/#{ActiveRestClient::VERSION}"
end
post :pois, "/yfgsnnyf"
before_request do |name, request|
request.headers["Accept"] = "application/json"
request.post_params[:apiKey] = "#"
end
end
Customer.pois(custId: 66)
__END__
The RequestBin correctly receives custId = 66 and apiKey = #
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment