Just messing around with Github API and oauth. I have got to the point where I receive the access_token
back from GH.
I have so far:
url := "https://github.com/login/oauth/access_token"
params := map[string]string{"client_id": client_id, "client_secret": client_secret, "code": code}
data, _ := json.Marshal(params)
resp, _ := http.Post(url, "application/json", bytes.NewBuffer(data))
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
but I would now like to access the response parts. According to the GH docs, they are in the form
access_token=e72e16c7e42f292c6912e7710c838347ae178b4a&scope=user%2Cgist&token_type=bearer
Do I need to parse the string or is there a "better" way?