我怎么能做类似http://myanimelist.net/modules.php?go=api#verifycred
又名“curl -u 用户:密码http://myanimelist.net/api/account/verify_credentials.xml ”
我希望选择我的代码到目前为止的 id
string url = "http://myanimelist.net/api/account/verify_credentials.xml";
WebRequest request = WebRequest.Create(url);
request.ContentType = "xml";
request.Method = "GET";
request.Credentials = new NetworkCredential(username, password);
byte[] buffer = Encoding.GetEncoding("UTF-8").GetBytes("xml/user/id"); // i think this line?
Stream reqstr = request.GetRequestStream();
reqstr.Write(buffer, 0, buffer.Length);
reqstr.Close();
但我收到一个错误“ reqstr.Write(buffer, 0, buffer.Length)
”无法发送带有这种动词类型的内容主体,我尝试过谷歌搜索但没有占上风,我正在使用 c#