# Conflicts:
#	app/controllers/ecloud_controller.rb
dev_SaaS
guange 6 years ago
parent 0e445b3209
commit 6f15d83b87

@ -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

Loading…
Cancel
Save