title: How to simply print a fetched JSON data on display in Lua? (to do so, write an existing PHP code in Lua)
body: <p>In <strong>Lua</strong>, I would like to <strong>print JSON API data on a display of a device (Android smart phone)</strong> (eg data is <a href="http://biocache.ala.org.au/ws/occurrences/search?q=Banksia%20Serrata" rel="nofollow noreferrer">http://biocache.ala.org.au/ws/occurrences/search?q=Banksia%20Serrata</a>). I believe I should use the following pieces, but not sure how to do it properly. Can somebody help me quickly?</p>
  
  <pre><code>local json = require( "json" )
  network.request(url,"POST",listener,postData)
  </code></pre>
  
  <p><strong>If you know PHP</strong>, it may be easier to understand my question. I have the following simple PHP code to fetch data via API and print it. And, I would like to do the same thing in Lua. </p>
  
  <pre><code>&lt;?php
  $handle = fopen("http://biocache.ala.org.au/ws/occurrences/search?q=Banksia%20Serrata", "r");
  $contents = stream_get_contents($handle);
  fclose($handle);
  $jsoncont = json_decode($contents);
  //print_r($jsoncont);
  print "&lt;h2&gt;Results"&lt;/h2&gt;";
  foreach($jsoncont-&gt;occurrences as $occ) {
      print $occ-&gt;uuid."&lt;br /&gt;";
  }
  ?&gt;
  </code></pre>
  
  <p>Many thanks!</p>
  
  <p>PS It is highly appreciated if you can show me an example for both POST and GET, if there is a big difference.</p>