Created
May 6, 2015 08:32
-
-
Save andyjeffries/6077d5fc2f74645a801a to your computer and use it in GitHub Desktop.
Example ARC for Abel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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