title: Using urllib3 to fetch JSON data
body: <p>I have written my own URL shortener in PHP and now am trying to develop a python frontend for it. My python script is as follows:</p>
  
  <pre><code>import certifi
  import urllib3
  import json
  manager = urllib3.PoolManager(
      cert_reqs='CERT_REQUIRED',
      ca_certs=certifi.where())
  url = input("Please enter a URL: ")
  short = manager.request("GET", "https://www.get-short.net/feed.php?i=" + url)
  data = short.read(decode_content=True)
  print(json.loads(data))
  </code></pre>
  
  <p>and, when I run it, I get the following output when I type in a URL    </p>
  
  <pre><code>c:\Projects&gt;python short.py
  Please enter a URL: https://docs.python.org/2/library/json.html
  Traceback (most recent call last):
  File "short.py", line 10, in &lt;module&gt;
      print(json.loads(data))
  File "C:\Program Files\Python36\lib\json\__init__.py", line 354, in loads
      return _default_decoder.decode(s)
  File "C:\Program Files\Python36\lib\json\decoder.py", line 339, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Program Files\Python36\lib\json\decoder.py", line 357, in raw_decode
      raise JSONDecodeError("Expecting value", s, err.value) from None
  json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  </code></pre>
  
  <p>I know the problem is either my code or my JSON output but what do I have to do to make it work</p>