1. 使用HttpClient包
#write code here
using HTTPClient.HTTPC
using JSON
using Base.Test
r=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)