我是围棋语言的新手,我试图用围棋语言阅读邮递员的载体授权并另存为字符串变量。
func ExampleParse(myToken string, myKey string) bool {
//read bearer header auth from post man and store the variable and store in myToken
token, err := jwt.Parse(myToken, func(token *jwt.Token) (interface{}, error) {
return []byte(myKey), nil
})
if err == nil && token.Valid {
fmt.Println("Your token is valid. I like your style.")
return false
} else {
fmt.Println("This token is terrible! I cannot accept this.")
return true
}
}
我如何从邮递员那里读取此请求并读取从api发送的令牌,以比较使用gin gonic发送的令牌?