Documentation ¶
Index ¶
- Constants
- Variables
- func Do(req *http.Request, opt *ClientOption) (*http.Response, error)
- type Challenge
- func (h Challenge) ComputeResponse(method, uri, entity, username, password string) Challenge
- func (info Challenge) GetChallengeItemFormat(itemKey string) string
- func (info Challenge) GetChallengeItemPure(itemKey string) string
- func (info Challenge) IsDigestAuth() bool
- func (info Challenge) SetChallengeItem(itemKey string, itemValue string)
- func (info Challenge) ToAuthorizationStr() string
- type Client
- type ClientOption
Constants ¶
View Source
const ( KEY_DIGEST = "Digest" KEY_AUTH_SCHEMA = "auth_schema" KEY_QOP = "qop" KEY_NONCE = "nonce" KEY_CNONCE = "cnonce" KEY_USERNAME = "username" KEY_NONCE_COUNT = "nc" KEY_OPAQUE = "opaque" KEY_RESPONSE = "response" KEY_REALM = "realm" KEY_AUTHORIZATION = "Authorization" KEY_URI = "uri" KEY_WWW_Authenticate = "WWW-Authenticate" )
Variables ¶
View Source
var DefaultClient = &Client{is_init: true}
static Defualt Client
Functions ¶
Types ¶
type Challenge ¶
The 401 (Unauthorized) response message is used by an origin server to challenge the authorization of a user agent.
And the CHALLENGE will include informations about auth
func GetChallengeFromHeader ¶
func NewChallenge ¶
func (Challenge) ComputeResponse ¶
base challenge to compute the response, and the response will be checking by server
func (Challenge) GetChallengeItemFormat ¶
some specific key, will add qutation mark
func (Challenge) GetChallengeItemPure ¶
func (Challenge) IsDigestAuth ¶
func (Challenge) SetChallengeItem ¶
func (Challenge) ToAuthorizationStr ¶
format challenge header to authorization header
MAYBE you should computeResponseFirst()
type Client ¶
if option is set, get challenge at construct time if option not set, ever digest auth will send 2 request
type ClientOption ¶
type ClientOption struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.