lib/dovico/api_client.rb in dovico-1.1.0 vs lib/dovico/api_client.rb in dovico-1.2.0
- old
+ new
@@ -22,10 +22,14 @@
def put(path, params: {}, body: nil)
perform!(:put, path, params: params, body: body)
end
+ def delete(path, params: {}, body: nil)
+ perform!(:delete, path, params: params, body: body)
+ end
+
private
attr_accessor :client_token, :user_token
def authorization_token
@@ -58,10 +62,14 @@
puts "Description: #{response["Description"]}"
puts ""
raise "Error during HTTP request"
end
- JSON.parse(response.body)
+ if response.body.length > 0
+ JSON.parse(response.body)
+ else
+ nil
+ end
end
end
end
end