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
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.
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
The text was updated successfully, but these errors were encountered: