-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Kacper Walanus edited this page Feb 27, 2015
·
6 revisions
Callapi::Config.configure { |config| config.api_host = 'http://your.api.org/v2' }
Callapi::Routes.draw do
get :notes
post :notes
end
get_notes_call.data.each do |note|
puts note['title']
end
get_notes_call.body #=> '[{"id":1,"title":"Jogging in park"},{"id":2,"title":"Pick-up posters from post-office"}]'
# Request with params
post_notes_call(id: 1, title: "Swimming")
# Request with params and headers
post_notes_call(id: 1, title: "Swimming").add_headers('X-SECRET-TOKEN' => '783hdkfds349')