Re: [go-nuts] Re: Get request send me hmtl content but works fine from python and curl

2020-09-20 Thread ryan embgrets
Thanks everyone for your valuable feedback. I was able to figure out the issue that was happening due to the case-sensitive nature of the loginId header, which was being normalized in golang. So, after adding the below snippet i was able to make it work. req.Header["loginId"] = []string{"0610A62F

Re: [go-nuts] Re: Get request send me hmtl content but works fine from python and curl

2020-09-19 Thread ryan embgrets
Thanks for taking time to answer my question. I have put the actual data except the loginId header.. https://play.golang.org/p/KrnxWLVj8s2 But i still get the html content in golang but when i use python i get the invalid api credentials. Due to incorrect loginId header. import requests r = req

[go-nuts] Get request send me hmtl content but works fine from python and curl

2020-09-19 Thread ryan embgrets
I am trying to call a simple api by using golang. But, each time it sends me html content of login page instead of actual data. But same get request works from python and curl. package main import ( "fmt" "io/ioutil" "net/http" "os" ) func main() { client := &http.Client{} req, err := http.N