Closed ikandaswamy closed 7 years ago
Found the solution. slist1 := []string{} slist1 = append(slist1, "X-Temp-Header: "+util.VERSION) for _, head := range header { // Append to the list of Header fields slist1 = append(slist1, head) } myCurl.Setopt(curl.OPT_HTTPHEADER, slist1)
-> This works. We cannot pass in a [] of string directly (as described in the issue), because that throws an error.
Thanks Isha
maybe we can hold the reference to the list?
When i set the following and then execute, I get an error saying the page doesn't exist. But when i do the same using curl it works fine.
myCurl.Setopt(curl.OPT_HTTPHEADER, []string{"User-Agent: ikandaswamy", "X-Temp-Header : cb/123"})
The corresponding curl query is curl -H "User-Agent:ikandaswamy" -H "X-N1QL-U: abc" https://api.github.com/users/ikandaswamy/repos
Is there something I'm doing incorrectly ?
Thanks Isha