Skip to content

Instantly share code, notes, and snippets.

@clairmont32
Created October 9, 2020 23:50
Show Gist options
  • Save clairmont32/c66131934c8b4d24b70afeea4a7f8e45 to your computer and use it in GitHub Desktop.
Save clairmont32/c66131934c8b4d24b70afeea4a7f8e45 to your computer and use it in GitHub Desktop.
Quick Gist to GET Incursions in Eve
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