- 论坛徽章:
- 0
|
我是用c写的:
snprintf(buf, BUFFER_SIZE, "GET %s?%s=%s.3322.org&%s=%s&username=%s&password=%s HTTP/1.1\015\012", request,"hostname",host,"wildcard",wildcard ? "ON" : "OFF",user_name,password);
output(buf);
snprintf(buf,BUFFER_SIZE,"Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*\015\012");
output(buf);
snprintf(buf,BUFFER_SIZE,"Accept-Language: zh-cn\015\012");
output(buf);
snprintf(buf,BUFFER_SIZE,"Accept-Encoding: gzip, deflate\015\012");
output(buf);
snprintf(buf,BUFFER_SIZE,"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 360SE)\015\012");
output(buf);
snprintf(buf,BUFFER_SIZE,"Host: %s\015\012",server);
output(buf);
snprintf(buf,BUFFER_SIZE,"Connection: Keep-Alive\015\012");
output(buf);
snprintf(buf,BUFFER_SIZE,"Authorization: Basic d2lzaGVzMTIzOjE5OTA3Mg==\015\012");
output(buf);
snprintf(buf, BUFFER_SIZE,"Cookie: username=%s;\015\012",user_name);
我按格式发出内容,抓包内容也是和发送是一样的,但再读取的时候是 Cookie: username=%s 这样的请求内容 ,根本就没有解析出内容
怎么回事? |
|