Merge pull request #2838 from betagouv/rest-client
Simplify ApiCarto::API.call
This commit is contained in:
commit
00dd1ed806
1 changed files with 1 additions and 3 deletions
|
@ -12,11 +12,9 @@ class ApiCarto::API
|
||||||
private
|
private
|
||||||
|
|
||||||
def self.call(url, geojson)
|
def self.call(url, geojson)
|
||||||
verify_ssl_mode = OpenSSL::SSL::VERIFY_NONE
|
|
||||||
params = geojson.to_s
|
params = geojson.to_s
|
||||||
|
|
||||||
client = RestClient::Resource.new(url, verify_ssl: verify_ssl_mode)
|
RestClient.post(url, params, content_type: 'application/json')
|
||||||
client.post(params, content_type: 'application/json')
|
|
||||||
|
|
||||||
rescue RestClient::InternalServerError
|
rescue RestClient::InternalServerError
|
||||||
raise RestClient::ResourceNotFound
|
raise RestClient::ResourceNotFound
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue