I am having trouble adding basic authentication to my http get. Curl commands seem to work fine against this. But I get a 403 forbidden when I try the call from my golang script. Any help will be appreciated, thank you.
func main() {
var url = "http://localhost:4002/wallet/address"
req, err := http.Get(url)
if err != nil {
panic(err)
}
req.Header.Add("Authorization", "Basic dGVzdHVzZXI6dGVzdHVzZXI=")
defer req.Body.Close()
fmt.Println(req)
}