How to Generate the HTTP Content-Type Header in C?
问题 So I'm working on a networking assignment to produce a basic HTTP/1.0 web server in C. I have most of it figured out, but one of the requirements is that it properly populate the Content-Type field in the header, and I can't seem to find any way to do this automatically. I'm already using fstat() to get the file size and when it was last modified, and I noticed that also includes a "st_objtype" field, but after some research it looks like this is just the AS/400 object type (which is