I am attempting to create an HTTP server in C++. Right now, the program only accepts a connection on port 80 and displays recieved text. When I run the program and type "[my IP]/index.html" into Internet Explorer, my program outputs the following:
GET /index.html HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
Host: [my IP]
(two line breaks at end)
My question is, how do I send a file to a browser? Does it require a header? Simply sending text does not work.
XSquared's link was helpful. Thank you for your help.