Repository: influxdata/influxdb-client-python

Issue:
trim trailing slash for urls
When using a url without a trailing slash, everything works fine:

`client = InfluxDBClient(url="https://us-west-2-1.aws.cloud2.influxdata.com", token=token, org=org, debug=True)`

But when adding a trailing slash to the url:
`client = InfluxDBClient(url="https://us-west-2-1.aws.cloud2.influxdata.com/", token=token, org=org, debug=True)`

the error that comes back is `HTTP response body: {"code":"not found","message":"path not found"}` when I use InfluxDB cloud.

For localhost, without a slash, i get a 200, but with a slash, i get a 204.

IMO, we should detect and trim the trailing slash from the connection urls.

Discussion:

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5122bb1..2bf8f08 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@
 ### Bug Fixes
 1. [#85](https://github.com/influxdata/influxdb-client-python/issues/85): Fixed a possibility to generate empty write batch
 2. [#86](https://github.com/influxdata/influxdb-client-python/issues/86): BREAKING CHANGE: Fixed parameters in delete api - now delete api accepts also bucket name and org name instead of only ids
+1. [#93](https://github.com/influxdata/influxdb-client-python/pull/93): Remove trailing slash from connection URL
 
 ## 1.6.0 [2020-04-17]
 
diff --git a/influxdb_client/client/influxdb_client.py b/influxdb_client/client/influxdb_client.py
index a8ca4ee..a78c130 100644
--- a/influxdb_client/client/influxdb_client.py
+++ b/influxdb_client/client/influxdb_client.py
@@ -40,7 +40,10 @@ class InfluxDBClient(object):
         self.default_tags = default_tags
 
         conf = _Configuration()
-        conf.host = self.url
+        if self.url.endswith("/"):
+            conf.host = self.url[:-1]
+        else:
+            conf.host = self.url
         conf.enable_gzip = enable_gzip
         conf.debug = debug
 


Test patch:
diff --git a/tests/test_BucketsApi.py b/tests/test_BucketsApi.py
index a528bf0..876e5e6 100644
--- a/tests/test_BucketsApi.py
+++ b/tests/test_BucketsApi.py
@@ -37,6 +37,7 @@ class BucketsClientTest(BaseTest):
             assert self.buckets_api.find_bucket_by_id(my_bucket.id)
         assert "bucket not found" in e.value.body
 
+    @pytest.mark.skip(reason="https://github.com/influxdata/influxdb/issues/14900")
     def test_find_by_name(self):
         my_org = self.find_my_org()
 
diff --git a/tests/test_InfluxDBClient.py b/tests/test_InfluxDBClient.py
new file mode 100644
index 0000000..1e8da1d
--- /dev/null
+++ b/tests/test_InfluxDBClient.py
@@ -0,0 +1,13 @@
+import unittest
+
+from influxdb_client import InfluxDBClient
+
+
+class InfluxDBClientTest(unittest.TestCase):
+
+    def test_TrailingSlashInUrl(self):
+        client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org")
+        self.assertEqual('http://localhost:9999', client.api_client.configuration.host)
+
+        client = InfluxDBClient(url="http://localhost:9999/", token="my-token", org="my-org")
+        self.assertEqual('http://localhost:9999', client.api_client.configuration.host)