little3399 Active Member Licensed User Longtime User Jul 1, 2015 #1 Hi I using the HTTPUTILS2.POSTSTRING TO POST a request to a url and returne a error message : {"error":"unsupported_grant_type","error_description":"The authorization grant type is not supported"} JobName = Baidu_Auth, Success = false Error: Bad Request But I post the same request in the mobile browser , it can works very well , the URL post link was : https://openapi.baidu.com/oauth/2.0...lient_secret=MgRLi6s8Gq3b4RLqZWNOrySjczGuyKGP and attachment was my code ... need help ! Tks! Attachments BaiduVoice.zip BaiduVoice.zip 7.1 KB · Views: 259
Hi I using the HTTPUTILS2.POSTSTRING TO POST a request to a url and returne a error message : {"error":"unsupported_grant_type","error_description":"The authorization grant type is not supported"} JobName = Baidu_Auth, Success = false Error: Bad Request But I post the same request in the mobile browser , it can works very well , the URL post link was : https://openapi.baidu.com/oauth/2.0...lient_secret=MgRLi6s8Gq3b4RLqZWNOrySjczGuyKGP and attachment was my code ... need help ! Tks!
Erel B4X founder Staff member Licensed User Longtime User Jul 1, 2015 #2 The browser sends GET requests (Job.Download). Upvote 0
little3399 Active Member Licensed User Longtime User Jul 1, 2015 #3 HI, Erel I change to send GET request , but the result was the same as the POST request ... Attachments BaiduVoice_get.zip BaiduVoice_get.zip 7.2 KB · Views: 251 Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jul 1, 2015 #4 Try to add user agent header: https://www.b4x.com/android/forum/threads/set-http-request-header-with-httputils2.39413/#content Upvote 0
Try to add user agent header: https://www.b4x.com/android/forum/threads/set-http-request-header-with-httputils2.39413/#content
little3399 Active Member Licensed User Longtime User Jul 2, 2015 #5 Hi Appears to be invalid, even if according to your suggestion... Attachments BaiduVoice_get.zip BaiduVoice_get.zip 7.3 KB · Views: 255 BaiduVoice_post.zip BaiduVoice_post.zip 7.3 KB · Views: 236 Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jul 2, 2015 #6 Job.Download2 adds the question mark for you. Remove it from SysCnf.Baidu_AuthUrl and it will work. Upvote 0