HttpWebRequest request = (HttpWebRequest)WebRequest.Create(@"https://api.weixin.qq.com/cv/ocr/comm?access_token=" + getAccessToken());
request.Method = "post";
request.ContentType = "multipart/form-data";
byte[] datas = File.ReadAllBytes(@imgPath);
request.ContentLength = datas.Length;
Stream stream = request.GetRequestStream();
stream.Write(datas, 0, datas.Length);
stream.Close();
try {
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader myStreamReader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
string retString = myStreamReader.ReadToEnd();
Debug.WriteLine(retString);
return null;
} catch {
Debug.WriteLine("失败");
return null;
}
返回是:{"errcode":41005,"errmsg":"media data missing hint: [Jceyla0861w783] rid: 641c203d-7e15e206-523ae08c"}
这是什么情况呢?
{"errcode":41005,"errmsg":"media data missing hint: [euKmIA0205w972] rid: 648cfc34-1302fb5b-5633b4eb"}