The data provider has an example in python:
url = "xxx"
parameter = {
"dataset": "TaiwanStockInfo",
"token": "", # 參考登入,獲取金鑰
}
resp = requests.get(url, params=parameter)
How to translate these simple python code into Julia language?
I try many times but fail…below is my fail example:
url="xxx"
parameter = Dict("dataset" => "TaiwanVariousIndicators5Seconds",
"start_date" => "2020-07-01",
"end_date" => "2020-07-27",
"token" => "xxx")
pms=JSON.json(parameter)
r=HTTP.request("GET", url,["Content-Type" => "application/json"],pms)
or
url="xxx"
parameter = Dict("dataset" => "TaiwanVariousIndicators5Seconds",
"start_date" => "2020-07-01",
"end_date" => "2020-07-27",
"token" => "xxx")
r=HTTP.request("GET", url,["Content-Type" => "application/json"],parameter)
parameter = ["dataset"=> "TaiwanStockInfo",
"token" => "xxx"]
HTTP.request("GET", url,
["Content-Type" => "application/json"],
parameter)
All above code are fail and return error message like this:
“HTTP.ExceptionRequest.StatusError(422, “GET”, “/api/v4/data”, HTTP.Messages.Response:”