Adding Authorization header to urlFetch GET request

26 views
Skip to first unread message

3du...@gmail.com

unread,
Apr 25, 2015, 5:00:35 PM4/25/15
to google-ap...@googlegroups.com

Currently I have this but It doesn't work, am I doing it correctly?


       
// send get request
        client
:= urlfetch.Client(ctx)
        req
, err := http.NewRequest("GET", url, nil); if err != nil { ds.Error(fn, err); break }
        req
.SetBasicAuth("root", "root")
        resp
, err := client.Do(req); if err != nil { ds.Error(fn, err); break }



3du...@gmail.com

unread,
Apr 27, 2015, 9:00:12 AM4/27/15
to google-ap...@googlegroups.com

To answer my own question, this actually works fine upon further testing.
Reply all
Reply to author
Forward
0 new messages