contentType的类型值的介绍

 

常遇到下面的几种情况:


1、 服务端需要返回一段普通文本给客户端,Content-Type="text/plain"
2 、服务端需要返回一段HTML代码给客户端 ,Content-Type="text/html"
3 、服务端需要返回一段XML代码给客户端 ,Content-Type="text/xml"
4 、服务端需要返回一段javascript代码给客户端,text/javascript
5 、服务端需要返回一段json串给客户端,application/Json

 

 

比较全面的contentType的类型值

 

文件扩展名 Content-Type(Mime-Type) 文件扩展名 Content-Type(Mime-Type)
.*( 二进制流,不知道下载文件类型) application/octet-stream .tif image/tiff
.asp text/asp .asx video/x-ms-asf
.au audio/basic .avi video/avi
.awf application/vnd.adobe.workflow .biz text/xml
.bmp application/x-bmp .bot application/x-bot
.cit application/x-cit .class java/*
.csi application/x-csi .css text/css
.dcd text/xml .dcx application/x-dcx
.dib application/x-dib .dll application/x-msdownload
.doc application/msword .dot application/msword
.drw application/x-drw .dtd text/xml
.dwf Model/vnd.dwf .dwf application/x-dwf
.etd application/x-ebx .exe application/x-msdownload
.gif image/gif .gl2 application/x-gl2
.hrf application/x-hrf .hta application/hta
.htc text/x-component .htm text/html
.html text/html .htt text/webviewhtml
.htx text/html .icb application/x-icb
.ico image/x-icon .ico application/x-ico
.iff application/x-iff .ig4 application/x-g4
.igs application/x-igs .iii application/x-iphone
.img application/x-img .ins application/x-internet-signup
.java java/* .jfif image/jpeg
.jpe image/jpeg .jpe application/x-jpe
.jpeg image/jpeg .jpg image/jpeg
.jpg application/x-jpg .js application/x-javascript
.jsp text/html .la1 audio/x-liquid-file

 

 

文章转载自:      response的contentType的类型值    http://www.studyofnet.com/news/216.html

 

你可能感兴趣的:(asp.net,C#)