2012-06-27 26 views

回答

6

the api.go documentation

由於谷歌App Engine的網址提取API要求每個請求 情況下,你必須使用* plus.Service從HTTP處理程序中。 該軟件包提供WithNoAuthPlus和WithOAuthPlus函數 ,您可以使用它來包裝HTTP處理程序,以便爲它們提供完全初始化* plus.Services的 。

實施例:

c := appengine.NewContext(r) 
trans := &oauth.Transport{ 
    Config: oauthConfig, 
    Transport: &urlfetch.Transport{Context: c}, 
} 
trans.Exchange(code) 
resp, err := trans.Client().Get(profileInfoURL) 
相關問題