如何使用c++ /MFC http POST到web表单
how to http POST to a web form using C++ /MFC?
我使用CInternetSession与GetHttpConnection,但我找不到任何关于如何填写和发布web表单的好信息。
这篇知识库文章解释了如何使用CInternetSession
模拟POST请求。
CString strHeaders = _T("Content-Type: application/x-www-form-urlencoded");
// URL-encoded form variables -
// name = "John Doe", userid = "hithere", other = "P&Q"
CString strFormData = _T("name=John+Doe&userid=hithere&other=P%26Q");
CInternetSession session;
CHttpConnection *pConnection = session.GetHttpConnection(_T("ServerNameHere"));
CHttpFile *pFile = pConnection->OpenRequest(CHttpConnection::HTTP_VERB_POST,
_T("FormActionHere"));
BOOL result = pFile->SendRequest(strHeaders, (LPVOID) (LPCTSTR) strFormData,
strFormData.GetLength());
相关文章:
- 如何使用curlpp通过POST方法上传文件和json数据
- 使用libcurl提交批量url的正确BING Api POST url是什么
- 用于将C++代码转换为 Web 程序集的脚本未终止
- C# DLL 从C++应用程序调用 SOAP Web 服务
- OpenCV(C++)处理来自JavaScript / Web Assembly的图像数据
- 命名空间 pqxx 无法识别 - 将 libpqxx 添加到 Windows 上的 Visual Studio Post
- 如何使用boost/beast从HTTP POST请求中解析和提取有效负载?
- 如何使用 curl 将 POST 请求从 python 重写为 C++
- 用于 progmem 的C++和头文件压缩的 Web 文件字节数组
- 来自带有mbedtls TLS的Mongoose Web服务器的错误消息
- 从简单的 POST 请求中解析异常
- Visual Studio 2017 中的 cpprestapi 问题找不到 POST/GET 常量
- 使用 cpp-httplib 的 POST 请求
- 使用 ESP8266/8285 将字符串从 Web 服务器转换为字节数组
- 在 c++ WWSAPI Web 服务中处理 WS-Security PasswordDigest 模式
- 如何捕获从 MFC Web 浏览器 c++ 发出的 GET/POST 请求
- Moodle REST Web 服务:将数组作为 POST 参数发送时出现问题
- 如何向包含多部分 HTTP POST 的 SendGrid Web API 发出请求
- 如何使用c++ /MFC http POST到web表单
- 一个简单的web服务器在c++中使用asio和form post从safari似乎不工作