问题描述
我只能尝试一小段代码。
char httpRequest[] = "POST http://myhost.com/ HTTP/1.1\r\n"
"Host: myhost.com\r\n"
"Content-Type: application/x-www-form-urlencoded\r\n"
"Content-Length: 10\r\n"
"Connection: close\r\n"
"\r\n"
"text1=test";
sock_error2 = send(tcpsock,httpRequest,strlen(httpRequest) + 1,0);
请求永远不会到达目标服务器,我在两侧都有数据包转储。
每当我将content-length更改为0时,服务器接收的数据包就没有正文。我在内容长度或回车符上做错了什么?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)