[英]How to determine the Content-Type in an HTTP Response
我正在构建一个Web服务器作为练习。 当我收到原始请求时,它将被解析为简单的语法树,并通过评估该树来构建响应。 我的问题是: When sending an HTTP Response, does the Content-Type field get set by taking the file extension of the requested resource and looking it up in a dictionary of MIME-types?
一个很好的例子是如何构造favicon.ico的响应。 任何对此的见解将是最有帮助的。 谢谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.