package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://authapi.moralis.io/challenge/request/aptos"
payload := strings.NewReader("{\"domain\":\"defi.finance\",\"statement\":\"Please confirm\",\"uri\":\"https://defi.finance/\",\"expirationTime\":\"2020-01-01T00:00:00.000Z\",\"notBefore\":\"2020-01-01T00:00:00.000Z\",\"resources\":[\"https://docs.moralis.io/\"],\"timeout\":15,\"chainId\":1,\"address\":\"0xfb2853744bb8afd58d9386d1856afd8e08de135019961dfa3a10d8c9bf83b99d\",\"publicKey\":\"0xfb2853744bb8afd58d9386d1856afd8e08de135019961dfa3a10d8c9bf83b99d\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept", "application/json")
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "YOUR_API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}