julia访问rest url

来源:互联网 发布:相机驱动源码 编辑:程序博客网 时间:2024/04/25 07:53

1. 使用HttpClient包

#write code hereusing HTTPClient.HTTPCusing JSONusing Base.Testr=HTTPC.post("http://localhost:8888/datacenter/api/strategy/short", {"data" => "000001,10#000002,10", "dataType" => "stock","buyDate" => "2012-05-03","count" => "1"})print(r.http_code)
2. 解析返回数据

r=HTTPC.post(strategy, data)result = JSON.parse(bytestring(r.body))print(result)





0 0