This is a bug I believe, and it took me 2-3 days to figure it out. Please do the following to get it

Posted C# java C++ 开源通信

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了This is a bug I believe, and it took me 2-3 days to figure it out. Please do the following to get it相关的知识,希望对你有一定的参考价值。

This is a bug I believe, and it took me 2-3 days to figure it out. Please do the following to get it working,

1) Remove the "?api-version=1.0" from your URL. I know it sounds strange but trust me their documentation is a mess.

2) Add a "Content-Type": "application/x-www-form-urlencoded" header in your request (hence you‘ll have to encode the post data values ... for example redirect_url=(encodedURL) etc

3) Remove unnecessary fields from post data REFER ... it should be like

{
    grant_type: "authorization_code",
    resource: "your resource",
    client_id: "your client Id",
    redirect_uri: "your redirect URL",
    client_secret: "your client secret",
    code: "the code u got"
}

 

I see you have done point 2 so you‘ll need to do point 1 and you‘re good to go.

Furthermore, if you want to get access_token quickly(if nothing I said works for you), then pass "client_credentials" in grant_type and you‘ll get a smaller response with access_token. But if you want the complete response with refresh_token as well, you‘ll have to do all those steps.

EDIT: There is one more mistake in their documentation, for Refresh Tokens >>> the URL should be oauth2/token and NOT oauth2/authorize

以上是关于This is a bug I believe, and it took me 2-3 days to figure it out. Please do the following to get it的主要内容,如果未能解决你的问题,请参考以下文章

hdu-2685 I won't tell you this is about number theory---gcd和快速幂的性质

This is us(我们的生活/我们这一天--一部超级值得推荐的美剧)

What is this "def" I heard of?

$(...)[0].attr is not a function问题

[2016-06-17]OMG美语笔记-Do you believe that it's all about timing to find a good job?

uniAppAPI ‘offCompassChange‘ is not yet implementedchooseLocationmapnextTickforceUpdate打开地图位置