func (a *Auth) FinishExplicit(code, redirectUri string) error {
	v := make(url.Values)
	v.Add("client_id", a.ClientID)
	v.Add("client_secret", a.ClientSecret)
	v.Add("code", code)
	v.Add("redirect_uri", redirectUri)
	req, err := http.NewRequest(
		http.MethodPost,
		"https://stackexchange.com/oauth/access_token",
		strings.NewReader(v.Encode()),
	)
	if err != nil {
		return err
	}
	req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
	res, err := http.DefaultClient.Do(req)
	if err != nil {
		return err
	}
	if res.StatusCode != 200 {
		return errors.New("unable to finish explicit auth")
	}
	b, err := ioutil.ReadAll(res.Body)
	if err != nil {
		return err
	}
	q, err := url.ParseQuery(string(b))
	if err != nil {
		return err
	}
	a.AccessToken = q.Get("access_token")
	return nil
}
// FinishExplicit completes explicit auth.
FinishExplicit completes explicit auth.
// FinishExplicit completes explicit auth .
func (a *Auth) FinishExplicit(code, redirectUri string) error {
	v := make(url.Values)
	v.Add("client_id", a.ClientID)
	v.Add("client_secret", a.ClientSecret)
	v.Add("code", code)
	v.Add("redirect_uri", redirectUri)
	req, err := http.NewRequest(
		http.MethodPost,
		"https://stackexchange.com/oauth/access_token",
		strings.NewReader(v.Encode()),
	)
	if err != nil {
		return err
	}
	req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
	res, err := http.DefaultClient.Do(req)
	if err != nil {
		return err
	}
	if res.StatusCode != 200 {
		return errors.New("unable to finish explicit auth")
	}
	b, err := ioutil.ReadAll(res.Body)
	if err != nil {
		return err
	}
	q, err := url.ParseQuery(string(b))
	if err != nil {
		return err
	}
	a.AccessToken = q.Get("access_token")
	return nil
}
func ( a * Auth ) FinishExplicit ( code , redirectUri string ) error { v := make ( url . Values ) v . Add ( " " , a . ClientID ) v . Add ( " " , a . ClientSecret ) v . Add ( " " , code ) v . Add ( " " , redirectUri ) req , err := http . NewRequest ( http . MethodPost , " " , strings . NewReader ( v . Encode ( ) ) , ) if err != nil { return err } req . Header . Set ( " " , " " ) res , err := http . DefaultClient . Do ( req ) if err != nil { return err } if res . StatusCode != 200 { return errors . New ( " " ) } b , err := ioutil . ReadAll ( res . Body ) if err != nil { return err } q , err := url . ParseQuery ( string ( b ) ) if err != nil { return err } a . AccessToken = q . Get ( " " ) return nil }
FinishExplicit completes explicit auth.
FinishExplicit completes explicit auth .