Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@cflewis
Created September 24, 2012 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cflewis/3778196 to your computer and use it in GitHub Desktop.
Save cflewis/3778196 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
)
func main() {
response, err := http.Get("https://raw.github.com/jbrooksuk/JSON-Airports/master/airports.json")
if err != nil {
log.Fatal(err)
os.Exit(1)
}
defer response.Body.Close()
responseBody, err := ioutil.ReadAll(response.Body)
fmt.Printf("%s\n", string(responseBody))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment