Skip to content
gdotdesign edited this page Nov 3, 2014 · 3 revisions

The XMLHTTPRequest wrapper is available with the Fron::Request (documentation) class. It has a nicer api, and the resoponses are wrapped into an instance of the Response class.

  • helpers methods for get, post and put requests
  • helpers for getting the data out of the response json and dom
request = Fron::Request.new '/test', 'Content-Type' => 'application/json'
request.get do |response|
  puts response.json if response.ok?
end
Clone this wiki locally