我正在尝试将参数发送到网址。
如果我不包含“dict”,这很有效。
但是当我在括号中添加dict(如下所示)时,我注意到我的var“url”不包含字符串startdate或enddate。
我应该以其他方式指定这个吗?
OAuthRequest client = OAuthRequest.ForRequestToken("xxxxxx", "yyyyyyyy");
client.RequestUrl = "https://api.drum.is/assets/audusd/juice/";
var dict = new Dictionary<string, string> {
{"startdate", "20140101"},
{"enddate", "20140106"}
};
string auth = client.GetAuthorizationQuery(dict);
var url = client.RequestUrl + "?" + auth;
var request = (HttpWebRequest)WebRequest.Create(url);
request.Accept = "application/json, text/javascript";
var response = (HttpWebResponse) request.GetResponse();