I'm trying emulate browser, open intranet url and get status code 401. How to open url with NTLM auth or login, pass? Thanks
package main
import (
"gopkg.in/headzoo/surf.v1"
"fmt"
)
func main() {
bow := surf.NewBrowser()
bow.AddRequestHeader("Accept", "text/html")
bow.AddRequestHeader("Accept-Charset", "utf8")
err := bow.Open(url)
if err != nil {
panic(err)
}
fmt.Println(bow.StatusCode())
}
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/faaa1b45-7516-447c-8397-fa9c16cc549c%40googlegroups.com.
Googling for "NTLM http go client", the first result looks legit:
On Tue, Oct 22, 2019 at 10:20 PM <shirok...@gmail.com> wrote:
--I'm trying emulate browser, open intranet url and get status code 401. How to open url with NTLM auth or login, pass? Thanks
package main import ( "gopkg.in/headzoo/surf.v1" "fmt" ) func main() { bow := surf.NewBrowser() bow.AddRequestHeader("Accept", "text/html") bow.AddRequestHeader("Accept-Charset", "utf8") err := bow.Open(url) if err != nil { panic(err) } fmt.Println(bow.StatusCode()) }
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golan...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/778568c7-a746-41c3-be8b-386d5a91239c%40googlegroups.com.