You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello Team,
Getting error when trying the retrieve dividends http: panic serving 127.0.0.1:54063: 403 Forbidden: Forbidden
My question is to see if you can point me to the root cause, being the my Code or the API
source: https://github.com/timpalpant/go-iex
package main
import (
"fmt"
"html/template"
"net/http"
"github.com/timpalpant/go-iex"
)
func process(w http.ResponseWriter, r *http.Request) {
client := iex.NewClient(&http.Client{})
var s []string
symbols := []string{"AAPL", "SPY"}
for _, symb := range symbols {
stat, err := client.GetKeyStats(symb)
if err != nil {
panic(err)
}
s = append(s, fmt.Sprintf("DividendYield: %s", stat.DividendYield))
}
t, _ := template.ParseFiles("Dividends.html")
t.Execute(w, s)
}
////
func main() {
server := http.Server{
Addr: "127.0.0.1:8080",
}
http.HandleFunc("/process", process)
server.ListenAndServe()
}
Hello Team,
Getting error when trying the retrieve dividends
http: panic serving 127.0.0.1:54063: 403 Forbidden: Forbidden
My question is to see if you can point me to the root cause, being the my Code or the API
source: https://github.com/timpalpant/go-iex
The text was updated successfully, but these errors were encountered: