C# 对2captcha使用POST方法时出错
我想用2captchaapi解决验证码问题C# 对2captcha使用POST方法时出错,c#,selenium,html-agility-pack,webrequest,2captcha,C#,Selenium,Html Agility Pack,Webrequest,2captcha,我想用2captchaapi解决验证码问题 string Key = "12345678901234567890123456789012"; string Method = "base64"; string DataForPost = $"key={Key}&method={Method}&imginstructions={Imginstructions}"; request.ContentLength = DataForPost.Length; string respons
string Key = "12345678901234567890123456789012";
string Method = "base64";
string DataForPost = $"key={Key}&method={Method}&imginstructions={Imginstructions}";
request.ContentLength = DataForPost.Length;
string responseText = "";
byte[] bytes = Encoding.ASCII.GetBytes(DataForPost);
request.ContentLength = bytes.Length;
using (Stream reqStream = request.GetRequestStream())
{
reqStream.Write(bytes, 0, bytes.Length);
reqStream.Close();
}
using (WebResponse resp = request.GetResponse())
{
Stream respStream = resp.GetResponseStream();
using (StreamReader sr = new StreamReader(respStream))
{
responseText = sr.ReadToEnd();
}
}
Imginstruction是图像的base64字符串,大小约为4KB。当我运行上述代码时,我收到了错误消息——“error\u ZERO\u CAPTCHA\u FILESIZE”。这个错误的意思是“文件大小小于100字节”,但我无法理解,因为文件大小约为4kb
如果你对这个问题有什么想法,请告诉我