Click here to Skip to main content
14,661,175 members
Rate this:
Please Sign up or sign in to vote.
See more:
I'm using this sniffer writen by a fellow member. I would like to know, because I don't see it. Can I get the content-type of an http header with this program?

Sniffing using Winsock[^]

Thank you.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Use "New Message" at the end of the article to ask the your question. The author will be notified by e-mail.

Member 7766180 wrote:
In the meantime what's your opinion my question?

Let me see… you want to look at HTTP protocol. OK, but it's all based on text (even transmission of binary files, via base64!). That said, you can do a little research: when you get a sniffed package, save it on disk and look at the text. It will give you pretty good idea on the format of data. To be on the safe side, confirm your finding with the HTTP standard, see[^] and references in this article. I don't thing this will be hard to find out.

Member 7766180 18-Aug-11 18:09pm
Will try it. Although I found that on the older post questions are rarely replied to. In the meantime what's your opinion my question?
Sergey Alexandrovich Kryukov 18-Aug-11 22:53pm
My opinion? I'm pretty sure I would find out by myself pretty fast -- please see my advice in the updated solution.
Member 7766180 18-Aug-11 23:23pm
Thank you. I think I'm closer. I just remembered that I have to reassemble first, then do a http request. So now that I have reassembled, in C++ how do I request so that I end up with this...

HTTP/1.1 200 OK
Date: Mon, 23 May 2005 22:38:34 GMT
Server: Apache/ (Unix) (Red-Hat/Linux)
Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
Etag: "3f80f-1b6-3e1cb03b"
Accept-Ranges: bytes
Content-Length: 438
Connection: close
Content-Type: text/html; charset=UTF-8

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100