|| at Nov 6, 2012 at 9:49 am
On Tuesday, November 6, 2012 10:20:11 AM UTC+1, bradfitz wrote:
Maybe. I'm not sure this is worth it. We try not to add everything in
the world to the standard library.
But it would be called BasicAuth() probably, without "Get" (which we avoid
using whenever possible). Feel free to send it in as a codereview
to get a discussion going
on golang-dev. httputil might even be the best place. Maybe http is okay,
given the existing setter precedent.
I will, thanks.
FWIW, I think it makes more sense in http, as you say given the existing
On a related note, I have a few additions like this and others, for example
for net/rpc's debug page I've added error counts and
a slice of callers/timeof tuples as well as being able to request the stats
in JSON format. I've found this to be useful when prototyping and
it's 'small' enough for the standard library IMO.
Does it make sense to send those right away as a code review?
net/http request's have a SetBasicAuth() method defined that sets the
HTTP Basic Authentication
Authorization header, I've found it convenient to have it's opposite
number for the responses, i.e.
func (r *Response) GetBasicAuth() (username string, password string, err
Would this be a welcome addition to net/http ?
I've attached a diff with a naive implementation, and some basic tests.