Simplify ApiCarto::API.call

SSL seems OK for https://apicarto.sgmap.fr
This commit is contained in:
gregoirenovel 2018-10-15 23:52:58 +02:00
parent 60a383e174
commit 5a326db650

View file

@ -12,11 +12,9 @@ class ApiCarto::API
private
def self.call(url, geojson)
verify_ssl_mode = OpenSSL::SSL::VERIFY_NONE
params = geojson.to_s
client = RestClient::Resource.new(url, verify_ssl: verify_ssl_mode)
client.post(params, content_type: 'application/json')
RestClient.post(url, params, content_type: 'application/json')
rescue RestClient::InternalServerError
raise RestClient::ResourceNotFound