Delphi Xe10 使用Idhttp get 新浪股票API

时间:2021-11-26 02:49:03
【文件属性】:
文件名称:Delphi Xe10 使用Idhttp get 新浪股票API
文件大小:878B
文件格式:TXT
更新时间:2021-11-26 02:49:03
Delphi http 股票API Delphi Xe10,通过Idhttp控件进行http get 的形式,实时获取新浪股票API接口提供的行情数据。

网友评论

  • 坑货,就这么多东西: procedure GetDemo; var IdHttp : TIdHTTP; Url : string;//请求地址 ResponseStream : TStringStream; //返回信息 ResponseStr : string; begin //创建IDHTTP控件 IdHttp := TIdHTTP.Create(nil); //TStringStream对象用于保存响应信息 ResponseStream := TStringStream.Create(''); try //请求地址(以新浪API接口为例) Url := 'http://hq.sinajs.cn/list=sh601006'; try IdHttp.Get(Url,ResponseStream); except on e : Exception do begin ShowMessage(e.Message); end; end; //获取网页返回的信息 ResponseStr := ResponseStream.DataString; //在窗体中写入组件 form2.Memo1.Text:=response
  • 有一定参考价值