HTTPD: how are Content-Type and Content-Encoding HTTP headers set ?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

HTTPD: how are Content-Type and Content-Encoding HTTP headers set ?

ソリューションへジャンプ
1,140件の閲覧回数
alexandrevincon
Contributor III

I am currently studying the "httpsrv" example project from MQX 4.0 and I would like to know how the HTTPD server determines the value of Content-Type in the HTTP reply's header ? Is it deduced from the extension of the file, ie ".html" files automatically lead to "text/html" and ".js" files to "application/javascript" ?

Also, I would like to try and gzip the pages to gain some space. Is the Content-Encoding header set to "gzip" in this case ?

Many thanks to anyone who can answer !

Best regards,

AV

0 件の賞賛
返信
1 解決策
922件の閲覧回数
Martin_
NXP Employee
NXP Employee

Hi AV,

c:\Freescale\Freescale_MQX_4_0\rtcs\source\httpd\httpd_supp.c

function httpd_sendfile()

Contenttype is based on the file extension.

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
923件の閲覧回数
Martin_
NXP Employee
NXP Employee

Hi AV,

c:\Freescale\Freescale_MQX_4_0\rtcs\source\httpd\httpd_supp.c

function httpd_sendfile()

Contenttype is based on the file extension.

0 件の賞賛
返信
922件の閲覧回数
alexandrevincon
Contributor III

Thanks a lot !

0 件の賞賛
返信