|
|
@ -157,6 +157,10 @@ class EcloudController < ApplicationController
|
|
|
|
def get(url)
|
|
|
|
def get(url)
|
|
|
|
uri = URI(url)
|
|
|
|
uri = URI(url)
|
|
|
|
res = Net::HTTP.start(uri.host, uri.port, use_ssl: url.start_with?('https')) do |http|
|
|
|
|
res = Net::HTTP.start(uri.host, uri.port, use_ssl: url.start_with?('https')) do |http|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## TODO
|
|
|
|
|
|
|
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
|
|
|
|
|
|
|
|
|
|
|
req = Net::HTTP::Get.new(uri)
|
|
|
|
req = Net::HTTP::Get.new(uri)
|
|
|
|
#req['Content-Type'] = 'application/json'
|
|
|
|
#req['Content-Type'] = 'application/json'
|
|
|
|
# The body needs to be a JSON string, use whatever you know to parse Hash to JSON
|
|
|
|
# The body needs to be a JSON string, use whatever you know to parse Hash to JSON
|
|
|
@ -170,6 +174,8 @@ class EcloudController < ApplicationController
|
|
|
|
def post(url)
|
|
|
|
def post(url)
|
|
|
|
uri = URI(url)
|
|
|
|
uri = URI(url)
|
|
|
|
res = Net::HTTP.start(uri.host, uri.port, use_ssl: url.start_with?('https')) do |http|
|
|
|
|
res = Net::HTTP.start(uri.host, uri.port, use_ssl: url.start_with?('https')) do |http|
|
|
|
|
|
|
|
|
## TODO
|
|
|
|
|
|
|
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
|
|
|
req = Net::HTTP::Post.new(uri)
|
|
|
|
req = Net::HTTP::Post.new(uri)
|
|
|
|
#req['Content-Type'] = 'application/json'
|
|
|
|
#req['Content-Type'] = 'application/json'
|
|
|
|
# The body needs to be a JSON string, use whatever you know to parse Hash to JSON
|
|
|
|
# The body needs to be a JSON string, use whatever you know to parse Hash to JSON
|
|
|
|