html 设置请求头,http请求头和响应头设置

windows中文操作系统默认gbk编码

nodejs服务器默认返回utf-8

content-type类型:

text/palin; 普通文本类型

text/html; html文档类型 比如res.end("

段落

"),后端返回的html文件,其实都是读取里面的内容作为字符串返回,或者二进制流数据.文件的读写就是流操作

text/xml ; xml 格式

image/jpeg ; jpg图片格式

image/png; png 图片类型

application/xhtml+xml ; XHTML格式

application/xml ; xml数据格式

application/json ; JSON格式

application/pdf ; PDF格式

application/msword ; word文档

application/octet-stream ; 二进制流数据,比如常见的文件下载

application/x-www-urlencoded; form表单的默认格式,{"key":"value"}

application/form-data; 在form表单中进行上传时使用的格式

text/css ; css文件

你可能感兴趣的:(html,设置请求头)