Last active
December 30, 2016 19:41
-
-
Save drKnoxy/ae673b6e7ef6ad8c55809d229502a3fc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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