1,593
社区成员
发帖
与我相关
我的任务
分享
function GetStreamingPrices:TQJson
var
....
begin
Result := TQJson.Create;
// Get
_RESTRequest.Method := rmGET;
//指定资源位置:'/prices'
_RESTRequest.Resource := TRequestSourceURITemplate.Prices;
//生成query串:accountId=12345&instruments=AUD_CAD%2CAUD_CHF
_RESTRequest.AddParameter(TQueryPairKey.AccountID,accountlist[0],pkGETorPOST);
_RESTRequest.AddParameter(TQueryPairKey.Instruments,'EUR_USD',pkGETorPOST);
//URL
._RestClient.BaseURL := 'https://stream-fxtrade.oanda.com/v1';
//执行
_RestRequest.Execute;
//解析为Json
Result.tryParse(_RESTResponse);
end;