Dim url As String="http://127.0.0.1?v=sale"
Dim hc As new HttpClient(url)
Dim str As String
str=hc.GetData()
Dim jo As jarray=jarray.parse(str)
'MessageBox.Show(jo.Tostring)
For Each jt As Jtoken In jo
With Tables("Sale_Sale")
Dim r As Row=.addnew()
For Each c As Col In .Cols
r(c.name)=jt(c.name)
Next
End With
Next
接口返回json格式的结果:
[ { "公司名称": "软件开发公司", "订单编号": "SSDD202001050001", "客户类型": "系统内", "客户ID": "2", "收货地址ID": "0", "用户名称": "超级管理员", "创建时间": "2020-01-05", "订单来源": "" }, { "公司名称": "test公司1", "订单编号": "SSDD202001050002", "客户类型": "系统外", "客户ID": "2", "收货地址ID": "0", "用户名称": "张三", "创建时间": "2020-01-04", "订单来源": "" } ]