delphi 获取百度ai 获取token  
官方Delphi 学习QQ群: 682628230(三千人)
频道

delphi 获取百度ai 获取token


var
 idhttp2:Tidhttp;
 authHost:string;
 tokSl:Tstringlist;
begin
  authHost:= 'http://aip.baidubce.com/oauth/2.0/token';
  try
    tokSl:=Tstringlist.Create;
    idhttp2:=Tidhttp.Create(nil);
    toksl.Add('grant_type=' + grant_type);
    toksl.Add('client_id=' + client_id);
    toksl.Add('client_secret=' + client_secret);
    Result:=idhttp2.Post(authHost,toksl);
  finally
    toksl.Free;
    idhttp2.DisposeOf;
  end;

end;

 

获取结果:

{

    "access_token": "1.a6b7dbd428f731035f771b8d********.86400.1292922000-2346678-124328",

    "expires_in": 2592000,

    "refresh_token": "2.385d55f8615fdfd9edb7c4b********.604800.1293440400-2346678-124328",

    "scope": "public audio_tts_post ...",

    "session_key": "ANXxSNjwQDugf8615Onqeik********CdlLxn",

    "session_secret": "248APxvxjCZ0VEC********aK4oZExMB",

}


推荐分享
图文皆来源于网络,内容仅做公益性分享,版权归原作者所有,如有侵权请告知删除!
 

Copyright © 2014 DelphiW.com 开发 源码 文档 技巧 All Rights Reserved
晋ICP备14006235号-8 晋公网安备 14108102000087号

执行时间: 0.05487585067749 seconds