libcurl POST 登录失败,求救!!!

jngxx jngxx 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
如题,我在linux里使用libcurl模拟邮件系统登录,为什么一直都登录不进去呢?
返回的页面Body能看到提示,帐号或密码错误!!!
CURL* curl = curl_easy_init();

struct curl_slist* headers = NULL;
headers = curl_slist_append(headers, headerData);
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(curl, CURLOPT_POST, 1);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, “username=wang123&password=123456&language=zh_CN&enter=true”);
curl_easy_setopt(curl,CURLOPT_COOKIEFILE,"/tmp/cookie.txt");
curl_easy_setopt(curl,CURLOPT_COOKIEJAR, "/tmp/cookie.txt");

curl_easy_setopt(curl, CURLOPT_URL, “http://mail.***.com.cn:8001/webmail/index.php?module=operate&action=login”);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 5);
curl_easy_perform(curl);

我使用curl就可以./curl --data "username=wang&password=123456&language=zh_CN&enter=true" -X POST "http://mail.***.com.cn:8001/webmail/index.php?module=operate&action=login"


用tcpdoump抓包后看到POST数据是正确发出了的

...全文

相关推荐

评论 1
收藏 已收藏
分享
返回顶部
jngxx
工具平台和程序库 24,850 成员 27,330 内容