mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
23 lines
363 B
Ruby
23 lines
363 B
Ruby
require 'rest'
|
|
|
|
Rest.logger.level = Logger::DEBUG
|
|
rest = Rest::Client.new
|
|
|
|
base_url = "http://routertest.irondns.info/"
|
|
#"http://localhost:8080/"
|
|
|
|
response = rest.get(base_url)
|
|
puts "body:"
|
|
puts response.body
|
|
puts "\n\n"
|
|
|
|
|
|
# test post
|
|
begin
|
|
r = rest.post("#{base_url}somepost", :form_data=>{:x=>1, :y=>"a"})
|
|
rescue Rest::HttpError => ex
|
|
p ex
|
|
end
|
|
p r
|
|
p r.body
|