title: Formatting httplib response (json)
body: <p>After some research I was able to get data via RESTful API from a networking device:</p>
  
  <pre class="lang-py prettyprint-override"><code>if sys.version_info &gt;= (2,7,9):
      import ssl
      conn = httplib.HTTPSConnection('192.168.158.136', 443, context=ssl._create_unverified_context())
  else:
      conn = httplib.HTTPSConnection('192.168.158.136', 443)
  
  headers = {"Authorization"  : "Basic %s" % base64.b64encode('user:pass'),
             "Content-Type"   : "application/json"}
  
  url="https://192.168.158.136/wapi/v1.2/network?_return_fields%2b=extattrs"
  
  conn.request('GET', url, headers=headers)
  response = conn.getresponse()
  
  print response.read()
  conn.close()
  </code></pre>
  
  <p>This prints me a json formatted list of the objects I need:</p>
  
  <pre><code>[
      {
          "_ref": "network/ZG5zLm5ldHdvcmskMTAuMC4wLjAvMjQvMA:10.0.0.0/24/default", 
          "extattrs": {
              "Location": {
                  "value": "NAU"
              }
          }, 
          "network": "10.0.0.0/24", 
          "network_view": "default"
      }, 
      {
          "_ref": "network/ZG5zLm5ldHdvcmskMTAuMS4xLjAvMjQvMA:10.1.1.0/24/default", 
          "extattrs": {
              "Location": {
                  "value": "BTN"
              }
          }, 
          "network": "10.1.1.0/24", 
          "network_view": "default"
      }, 
      {
          "_ref": "network/ZG5zLm5ldHdvcmskMTAuMi4yLjAvMjQvMA:10.2.2.0/24/default", 
          "extattrs": {
              "Location": {
                  "value": "TRT"
              }
          }, 
          "network": "10.2.2.0/24", 
          "network_view": "default"
      }, 
      {
          "_ref": "network/ZG5zLm5ldHdvcmskMTkyLjE2OC4wLjAvMTYvMA:192.168.0.0/16/default", 
          "extattrs": {
              "Location": {
                  "value": "MCW"
              }
          }, 
          "network": "192.168.0.0/16", 
          "network_view": "default"
      }
  ]
  </code></pre>
  
  <p>Now I need to "somehow" format that as a list which just contains the "network" and the content of the <code>extattrs</code> "Location" (and only Location, there will be others to, but I need Location only) in the format of:</p>
  
  <p>Network Location, i.e.</p>
  
  <pre>
  10.0.0.0/24 NAU
  10.1.1.0/24 BTN
  10.2.2.0/24 TRT
  192.168.0.0/16 MCW
  </pre>
  
  <p>I'm struggling in getting this done, i.e. reformatting the JSON code I get back from the query.</p>