title: How to fix invalid URL error while using http.client?
body: <p>I am trying to hit an api using http.client of pyhton3 to simulate how I would do the same in a web browser.
  However, http.client feels that url is inappropriate.</p>
  
  <p>This is what I am trying to do.</p>
  
  <pre><code>import http.client
  
  connection = http.client.HTTPSConnection("https://analyticsapi.zoho.com/api/EmailAddress/WorkspaceName/TableName?ZOHO_ACTION=IMPORT&amp;ZOHO_OUTPUT_FORMAT=XML&amp;ZOHO_ERROR_FORMAT=XML&amp;ZOHO_API_VERSION=1.0&amp;authtoken=************&amp;ZOHO_IMPORT_TYPE=APPEND&amp;ZOHO_AUTO_IDENTIFY=TRUE&amp;ZOHO_ON_IMPORT_ERROR=ABORT&amp;ZOHO_CREATE_TABLE=TRUE&amp;ZOHO_FILE=/home/dev1/Desktop/Zoho/temporary.csv")
  connection.request("GET", "/")
  response = connection.getresponse()
  print("Status: {} and reason: {}".format(response.status, response.reason))
  
  connection.close()
  </code></pre>
  
  <p>And this is the error I am getting.</p>
  
  <pre><code>$ python3 pyToTestPushingCSV.py 
  Traceback (most recent call last):
    File "/usr/lib/python3.5/http/client.py", line 798, in _get_hostport
      port = int(host[i+1:])
  ValueError: invalid literal for int() with base 10: '//analyticsapi.zoho.com/api/usename/ATable/InsideTable?ZOHO_ACTION=IMPORT&amp;ZOHO_OUTPUT_FORMAT=XML&amp;ZOHO_ERROR_FORMAT=XML&amp;ZOHO_API_VERSION=1.0&amp;authtoken=****
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "pyToTestPushingCSV.py", line 3, in &lt;module&gt;
      connection = http.client.HTTPSConnection("https://analyticsapi.zoho.com/api/usename/ATable/InsideTable?ZOHO_ACTION=IMPORT&amp;ZOHO_OUTPUT_FORMAT=XML&amp;ZOHO_ERROR_FORMAT=XML&amp;ZOHO_API_VERSION=1.0&amp;authtoken=****************&amp;ZOHO_IMPORT_TYPE=APPEND&amp;ZOHO_AUTO_IDENTIFY=TRUE&amp;ZOHO_ON_IMPORT_ERROR=ABORT&amp;ZOHO_CREATE_TABLE=TRUE&amp;ZOHO_FILE=/home/dev1/Desktop/Zoho/temporary.csv")
    File "/usr/lib/python3.5/http/client.py", line 1233, in __init__
      source_address)
    File "/usr/lib/python3.5/http/client.py", line 762, in __init__
      (self.host, self.port) = self._get_hostport(host, port)
    File "/usr/lib/python3.5/http/client.py", line 803, in _get_hostport
      raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
  http.client.InvalidURL: nonnumeric port: '//analyticsapi.zoho.com/api/usename/ATable/InsideTable?ZOHO_ACTION=IMPORT&amp;ZOHO_OUTPUT_FORMAT=XML&amp;ZOHO_ERROR_FORMAT=XML&amp;ZOHO_API_VERSION=1.0&amp;authtoken=*************&amp;ZOHO_IMPORT_TYPE=APPEND&amp;ZOHO_AUTO_IDENTIFY=TRUE&amp;ZOHO_ON_IMPORT_ERROR=ABORT&amp;ZOHO_CREATE_TABLE=TRUE&amp;ZOHO_FILE=/home/dev1/Desktop/Zoho/temporary.csv'
  
  </code></pre>
  
  <p>When I hit the URL with my Browser it gives a good response back in XML which in short, succeeds.
  This is where I referred for documentation 
  Can you pin point where I went wrong?</p>