我正在尝试使用以下代码将订单发布到 REST API:
string URI = "https://api.myTrade.com/s1/order/" + orderId;
string myParameters = "symbol=AAPL&duration=day&side=buy&quantity=1&type=limit&price=1";
Console.Write("Parameters : " + myParameters + "\n");
using (WebClient wc = new WebClient())
{
wc.Headers[HttpRequestHeader.Authorization] = "Bearer " + token
wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
wc.Headers[HttpRequestHeader.Accept] = "application/json";
string responsebody = wc.UploadString(URI, myParameters);
//Console.Write("Output : " + responsebody + " ");
dynamic dynObj = JsonConvert.DeserializeObject(responsebody);
return responsebody;
}
我收到以下异常:
Input String was not in a correct format.
任何帮助是极大的赞赏。