标题: [网络连接] 怎么利用批处理调用wget,curl读取文本内容post,求教写法,有偿 [打印本页]
作者: 768768521 时间: 2017-8-7 21:32 标题: 怎么利用批处理调用wget,curl读取文本内容post,求教写法,有偿
本帖最后由 pcl_test 于 2017-8-7 22:02 编辑
怎么利用任何第三方或办法 wgeg,curl类调用下面文本内容post,有偿请高手写出完整语句
文本内容如下 http.txt
新请求post
https://www.nmap.org/nmap/api/licenses/
请求头:
Host: nmap.org
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:54.0) Gecko/20100101 Firefox/54.0
Accept: */*
Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate, br
Referer: https://nmap.org/pasrg/sfwert
X-CSRF-Token: REljeDItU1NzGjAvSmcMNgt/VDZRQBRjIQEOTQRjFQMDJjYdQ08QKg==
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 36
Cookie: language=eaed5098042e39c55cacf133c6e8b29b5f5336838e5c2e411e57695c71970203a%3A2%3A%7Bi%3A0%3Bs%3A8%3A%22language%22%3Bi%3A1%3Bs%3A5%3A%22zh-CN%22%3B%7D; _ym_uid=1502057250433169819; _ym_isad=2; _u=037591c8cab86f7dfd48edfdf86fa68a1d9a2932bd453c8f19cf4d3634357c28a%3A2%3A%7Bi%3A0%3Bs%3A2%3A%22_u%22%3Bi%3A1%3Bs%3A81%3A%22%5B9384%2C%223854aef71f890450e813da53f81ed2bef6ff7154ac12bff2a363642fb4804dd3%22%2C1209600%5D%22%3B%7D; _ym_visorc_44448889=w; _s=it1ihc9t6fm04shf7mcnk7u16a; _h=56f10194dc2fe06332629036b2d1b835ce17291da0c8c1735f3e0b2fba78f250a%3A2%3A%7Bi%3A0%3Bs%3A2%3A%22_h%22%3Bi%3A1%3Bs%3A32%3A%227SSWxJ_eO67NcmG0eHm56NFPGoUeqbCy%22%3B%7D
Connection: keep-alive
提交的数据:
ip=222.100.152.160&ip_id=10562&id=15437以上就是所有文本内容
能写出完整处理办法语句的,来拿悬赏,悬赏不多,1,2包烟钱还是得给的~~
作者: WHY 时间: 2017-8-8 18:42
连句“谢谢”都不舍得给的家伙,就不要说啥“一两包烟钱”啦,
在这里混的人智商都比你高。
伸手要代码也就罢了,现在居然明目张胆地骗代码。
可怜、可悲、更可恨。
作者: 523066680 时间: 2017-8-8 19:01
本帖最后由 523066680 于 2017-8-8 19:02 编辑
示例代码,不用谢- //post
- #include<stdio.h>
- #include<winsock2.h>
- #include<windows.h>
- #pragma comment(lib, "ws2_32.lib")
-
- int main()
- {
- int num;
-
- SOCKET s;
- WSADATA wsa;
- struct sockaddr_in serv;
-
- char sndBuf[1024], rcvBuf[2048];
-
- WSAStartup(MAKEWORD(2, 1), &wsa);
-
-
- if ((s = socket(AF_INET, SOCK_STREAM, 0))<0)
- {
- perror("socket error!");
- exit(1);
- }
-
- memset(&serv,0,sizeof(serv));
- serv.sin_family = AF_INET;
- serv.sin_port = htons(80);
- serv.sin_addr.S_un.S_addr = inet_addr("115.239.210.26");
-
- if ((connect(s, (struct sockaddr *)&serv, sizeof(serv)))<0)
- {
- perror("connet error!");
- exit(1);
- }
-
- memset(sndBuf, 0, 1024);
- memset(rcvBuf, 0, 2048);
-
- //头信息
- strcat(sndBuf, "POST ");
- strcat(sndBuf, "http://www.baidu.com");
- strcat(sndBuf, " HTTP/1.0\r\n");
- strcat(sndBuf, "Host: ");
- strcat(sndBuf, "baidu.com");
- strcat(sndBuf, "\r\n");
- strcat(sndBuf, "Connection: keep-alive\r\n");
-
- strcat(sndBuf, "\r\n");
-
- puts(sndBuf);
-
- if ((num = send(s,sndBuf,1024, 0))<0)
- {
- perror("send error!");
- exit(1);
- }
-
- puts("send success!\n");
-
- do
- {
- if ((num = recv(s, rcvBuf, 2048, 0))<0)
- {
- perror("recv error!");
- system("pause");
- exit(1);
- }
- else if (num>0)
- {
- printf("%s", rcvBuf);
- memset(rcvBuf, 0, 2048);
- }
- }
- while (num>0);
-
- puts("\nread success!\n");
-
- closesocket(s);
-
- system("pause");
- WSACleanup();
-
- return 0;
-
- }
复制代码
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |