Skip to content

net/http: add GetBasicAuth method to *http.Request #6779

Closed
@gopherbot

Description

@gopherbot

by jasper.timm:

For completeness sake it seems that, considering there is a SetBasicAuth method in
net/http which can be used to set the 'Authorization' header in a request, there should
be an equivalent method to GetBasicAuth credentials from a request as well, which given
a request would return the username and password given in the 'Authorization' header.

A discussion was created in the go-nuts google group:
https://groups.google.com/forum/#!topic/golang-nuts/EZMr3X2NPGc

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions