botanswer
AnisB 4 years ago
parent 2417954770
commit f3f1a8403d

@ -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()
}

Loading…
Cancel
Save