MFC http post传送文件报头 我最近使用mfc的http协议向服务端发送文件,使用post请求方法,但是报头一直不正确,用抓包抓出来看也没看出来个所以然,头疼啊,对于传送文件头部哪些信息是必须的,最好有个例子啊? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 if( post == NULL ) { SendString(sock,"GET "); strcpy(headerSend, "GET "); } else { SendString(sock,"POST "); strcpy(headerSend, "POST "); } SendString(sock,request); SendString(sock," HTTP/1.0\r\n"); SendString(sock,"Accept: image/gif, image/x-xbitmap," " image/jpeg, image/pjpeg, application/vnd.ms-excel," " application/msword, application/vnd.ms-powerpoint," " */*\r\n"); SendString(sock,"Accept-Language: en-us\r\n"); SendString(sock,"Accept-Encoding: gzip, deflate\r\n"); SendString(sock,"User-Agent: Mozilla/4.0\r\n"); if(postLength) { wsprintf(buffer,"Content-Length: %ld\r\n",postLength); SendString(sock,buffer); } SendString(sock,"Host: "); SendString(sock,host); SendString(sock,"\r\n"); GetChildItem recvfrom函数问题 昨天 和 孙辉 老师了, 踏实稳重 wrod中插入图表位置 请问,非模态窗口如何向CFormView发送消息,从而改变ListCtrl的数据? 请问如何设置视图的颜色 100分可能全是你的哦_高手进(如何操作外部对话框程序中各个控件) 请教:PDF格式的文件能编辑吗? VC中递归算法怎样控制计算速度? 问个触发事件定时存储的问题 这个error C2664怎么改啊? 为什么有些子frame的get_document返回空?
{
SendString(sock,"GET ");
strcpy(headerSend, "GET ");
}
else
{
SendString(sock,"POST ");
strcpy(headerSend, "POST ");
}
SendString(sock,request); SendString(sock," HTTP/1.0\r\n"); SendString(sock,"Accept: image/gif, image/x-xbitmap,"
" image/jpeg, image/pjpeg, application/vnd.ms-excel,"
" application/msword, application/vnd.ms-powerpoint,"
" */*\r\n"); SendString(sock,"Accept-Language: en-us\r\n"); SendString(sock,"Accept-Encoding: gzip, deflate\r\n"); SendString(sock,"User-Agent: Mozilla/4.0\r\n"); if(postLength)
{
wsprintf(buffer,"Content-Length: %ld\r\n",postLength);
SendString(sock,buffer);
}
SendString(sock,"Host: "); SendString(sock,host); SendString(sock,"\r\n");