content-Type:text/plain和text/html
来源:互联网 发布:薪酬调查数据分析 编辑:程序博客网 时间:2024/03/29 15:38
最近再看nodejs
建立服务的时候:
var http = require("http");+http.createServer(function (request, response) {
+ response.writeHead(200, {"Content-Type": "text/plain"});
+ response.write("Hello World");
+ response.end();
+}).listen(8000); 对这个response.writeHead(200, {"Content-Type": "text/plain"});不是很明了,特意百度了一下:
需要了解的概念
Content-Type:用于定义用户的浏览器或相关设备如何显示将要加载的数据,或者如何处理将要加载的数据
MIME:MIME类型就是设定某种扩展名的文件用一种应用程序来打开的方式类型,当该扩展名文件被访问的时候,浏览器会自动使用指定应用程序来打开。多用于指定一些客户端自定义的文件名,以及一些媒体文件打开方式。
text/html的意思是将文件的content-type设置为text/html的形式,浏览器在获取到这种文件时会自动调用html的解析器对文件进行相应的处理。
text/plain的意思是将文件设置为纯文本的形式,浏览器在获取到这种文件时并不会对其进行处理。
0 0
- content-Type:text/plain和text/html
- unacceptable content-type: text/plain}
- Request failed: unacceptable content-type: text/plain
- text/html和text/plain的区别
- text/html和text/plain的区别
- AFNetworking 错误 Request failed: unacceptable content-type: text/plain
- Content type 'text/plain;charset=UTF-8' not supported
- [MIME] Content-Type 、IE、MIME和 注册表的那些事 (text/plain 文件 下载)
- python text/plain' text/html' ****************************
- iOS- "unacceptable content-type: text/plain"等content-type bug解决方案
- AFNetwork 解码问题content-type: text/html
- Request failed: unacceptable content-type: text/html
- Request failed: unacceptable content-type: text/html
- AFNetworking不支持text/plain,错误解决方法"Request failed: unacceptable content-type: text
- iOS中,修改AFNetworking源文件可接收text/plain的方法"Request failed: unacceptable content-type: text/plain"
- <%@page contentType="text/html;charset=utf-8"%>和<meta http-equiv="Content-Type" content="text/html;>
- Bug收集:{ status code: 200, headers { "Content-Length" = 14; "Content-Type" = "text/plain;char
- text/html & text/plain的区别
- linux网络通信工具
- C++ 退出双层for循环,解决 break、return、continue无法实现问题
- 编译链接的整个过程
- C语言回调函数的使用
- HDU 5106 Bits Problem(数位DP->二进制大数模拟)@
- content-Type:text/plain和text/html
- Android进程保活招式大全
- JavaScript与Android Native的交互
- springMVC返回json数据乱码问题及@RequestMapping 详解
- Kemans算法及其Python 实现
- 开发感言
- Java对象转换(Map转换Object或者反转)
- JavaScript常用设计模式
- node.js 压缩混淆js代码