Created
October 9, 2020 23:50
-
-
Save clairmont32/c66131934c8b4d24b70afeea4a7f8e45 to your computer and use it in GitHub Desktop.
Quick Gist to GET Incursions in Eve
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
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
) | |
func main() { | |
req, getErr := http.Get("https://esi.evetech.net/latest/incursions") | |
if getErr != nil { | |
fmt.Println(getErr) | |
} | |
if req.StatusCode != http.StatusOK { | |
fmt.Printf("Received %v", req.Status) | |
} | |
defer req.Body.Close() | |
fmt.Println(req.Header) | |
body, readErr := ioutil.ReadAll(req.Body) | |
if readErr != nil { | |
fmt.Println("Error reading HTTP body") | |
fmt.Println(readErr) | |
} | |
fmt.Println(string(body)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment