I created this tool in order to help facilitate my new project of creating a web server using straight Winsock2 calls. After spending a couple of hours creating it, I realized I really did not need to have this tool. However, it has given me a better understanding of the headers returned from a 'GET' statement made to the website. For fun, try entering some popular website you know of and see if it returns anything you find odd. For example, typing in 'www.redhat.com' and having the Server line return "Microsoft/IIS".
Enter the URL in the top edit box and then hit the 'Get Data' button. This will get the default document in the URL you entered and the header information as seen by your browser, and what is returned by the server. This tool would be helpful for someone building a web browser, as opposed to a web server, but it does give you a good view of the header information returned. The source file is the same as you would get from using Internet Explorer and going to "view source".
- CodeProject people from this thread, who helped me sort out my \r\n problems
I initially tried to use the
CHttpFile.Read() member function but it only wanted to read in 4KB of data. I tried setting the buffer but could not get it to read in all the data to display in the HTML source box. I had to use the
ReadString() function instead and keep appending it to another data
CString. If anyone can elaborate on this for me, I would be much appreciative.
At this time I do not have any plans for this code just because I realized I really did not need it to write a web server. If you have any suggestions on how to upgrade the code, for a tool you would use, please let me know, as I am open to any suggestions.
- 07/14/2003 - Released article and code (version 1.0)