From f3f1a8403d058db4b3e43d99623332df9b20950d Mon Sep 17 00:00:00 2001 From: AnisB Date: Sun, 6 Sep 2020 06:30:48 +0100 Subject: [PATCH] update --- main.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 7144091..fbac765 100644 --- a/main.go +++ b/main.go @@ -1,3 +1,7 @@ +// test account (avicious.406+test@gmail.com) API key +// eZbV6TDcl2qUmtEAMLllN8qOHeb1hQiS8sVEoG2OmfqLym4UqihiFL83xgM2SLGPtz8HS2DeX45sk89B +// test offer id: https://hhtestnet.com/offers/F8W2srPJK2JKwYdh +// TODO: unmarshal json (encoding/json) package main import ( @@ -13,7 +17,15 @@ const ( ApiKey = "***REMOVED***" ) - + +type Notification struct { + Id int `json:"id"` + Title string `json:"title"` + Body string `json:"body"` + Link string `json:"link"` +} + + type response struct { Status string `json:"status"` ExchangeRateProviders []struct { @@ -23,7 +35,6 @@ type response struct { } func main() { - fmt.Println("hello world") //body:= strings.NewReader(' -X POST -H "Authorization: Bearer ***REMOVED***" -H "Content-Type: application/json"`) req, err := http.NewRequest("POST", TestApiEndpoint + "/notifications/read", nil) if err != nil { @@ -44,6 +55,5 @@ func main() { } fmt.Println(string(body)) - defer resp.Body.Close() - + defer resp.Body.Close() }