lib/splash/webadmin/portal/controllers/restclient.rb in prometheus-splash-0.8.1 vs lib/splash/webadmin/portal/controllers/restclient.rb in prometheus-splash-0.8.2
- old
+ new
@@ -1,15 +1,20 @@
WebAdminApp.get '/restclient' do
+ log = get_logger
+ log.call "WEB : restclient, verb : GET, controller : /restclient"
get_menu 4
slim :restclient, :format => :html
end
WebAdminApp.post '/restclient/query' do
+ log = get_logger
+ log.call "WEB : processes, verb : GET, controller : /restclient/query"
@method = params[:method]
@url = params[:url]
+ @body = params[:body]
@notfound = false
begin
- @result = RestClient::Request.execute(method: @method.to_sym, url: @url,timeout: 10)
+ @result = RestClient::Request.execute(method: @method.to_sym, url: @url,timeout: 10, payload: @body)
rescue SocketError
@result = false
rescue RestClient::NotFound => e
@notfound = true
@result = e.response