📜  使用 FoxPro 和 wwJsonServiceClient 调用 JSON REST 服务 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:43.749000             🧑  作者: Mango

代码示例1
url: https://west-wind.com/wconnect/weblog/ShowEntry.blog?id=920
////

do wwhttp
do wwJsonSerializer

loProxy = CREATEOBJECT("wwJsonServiceClient")

*** Make the service call
loAlbums = loProxy.CallService("http://albumviewerswf.west-wind.com/api/albums",
                               "","GET")
? loProxy.cErrorMsg

lnCount = loAlbums.Count

* ? loAlbums.Item(1).Titl

FOR EACH loAlbum in loAlbums 
   ? loAlbum.Title  + ;
     " by " + loAlbum.Artist.ArtistName + ;
     " (" +  TRANSFORM(loAlbum.Tracks.Count) + " tracks)"
   FOR EACH loTrack IN loAlbum.Tracks
        ? "  " + loTrack.SongName
   ENDFOR
ENDFOR