Skip to content

Instantly share code, notes, and snippets.

@drKnoxy
Last active December 30, 2016 19:41
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 drKnoxy/ae673b6e7ef6ad8c55809d229502a3fc to your computer and use it in GitHub Desktop.
Save drKnoxy/ae673b6e7ef6ad8c55809d229502a3fc to your computer and use it in GitHub Desktop.
import (
"encoding/json"
"fmt"
"net/http"
)
// ...
func main() {
url := baseURL + "/search/photos/?query=hats&client_id=" + applicationID
resp, err := http.Get(url)
if err != nil {
fmt.Printf("buggered")
}
defer resp.Body.Close()
var r PhotoResponse
if err := json.NewDecoder(resp.Body).Decode(&r); err != nil {
fmt.Printf("buggered")
}
fmt.Printf("%+v\n", r)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment