2015-09-19 79 views
0

我越來越想做一個GET請求,狗吠聲API時,下面的錯誤(V2):「INVALID_SIGNATURE」在Yelp的API請求

/**/cb({"error": {"text": "Signature was invalid", "id": "INVALID_SIGNATURE", "description": "Invalid signature. Expected signature base string: 

GET\u0026http%3A%2F%2Fapi.yelp.com%2Fv2%2Fsearch\u0026_%3D1442688327244%26callback%3Dcb%26location%3DSan%252BFrancisco%26oauth_consumer_key%3DXI67kdnHbzVrvcY6jAfQKQ%26oauth_consumer_secret%3DWg3-20tFWx82F952ORa7ZIotsVE%26oauth_nonce%3DXQbTeX%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1442688327%26oauth_token%3Dazu7S1QVuyIhn-LrHvBWIMR99OXceUyY%26term%3Dfood"}}) 

這裏是我提出的要求:

http://api.yelp.com/v2/search?callback=cb&callback=cb&location=San%2BFrancisco&oauth_consumer_key=XI67kdnHbzVrvcY6jAfQKQ&oauth_consumer_secret=Wg3-20tFWx82F952ORa7ZIotsVE&oauth_signature_method=HMAC-SHA1&oauth_token=azu7S1QVuyIhn-LrHvBWIMR99OXceUyY&term=food&oauth_timestamp=1442688327&oauth_nonce=XQbTeX&oauth_signature=boKHi1X0rcUfcic8EgOVpXQHi4M%3D&_=1442688327244 

我該如何解決這個錯誤?謝謝:)

回答

0

您添加callback=cb兩次刪除一個和URL應該是字母順序

http://api.yelp.com/v2/search?callback=cb&location=San%2BFrancisco&oauth_consumer_key=XI67kdnHbzVrvcY6jAfQKQ&oauth_consumer_secret=Wg3-20tFWx82F952ORa7ZIotsVE&oauth_nonce=XQbTeX&oauth_signature=boKHi1X0rcUfcic8EgOVpXQHi4M%3D&_=1442688327244&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1442688327&oauth_token=azu7S1QVuyIhn-LrHvBWIMR99OXceUyY&term=food