http头中的host字段详解
来源:互联网 发布:什么是三维编程 编辑:程序博客网 时间:2024/05/16 13:43
Host:客户端指定自己想访问的http服务器的域名/IP 地址和端口号。
今天同事问了一个问题引发了我对http头中host字段的详细思考,总结了以下5条。
1.host字段可以是域名,也可以是ip地址。host字段域名/ip后可以跟端口号,如Host: www.6san.com:8080
2.host可以由程序自定义,某些程序为了防止运营商或防火墙拦截会定义虚假host
3.http1.1中host字段可以是空值,http1.0中可以缺失host字段
4.http响应头中不包含host字段,所以wireshark中http.host过滤到的都是请求包
5.因为http头中的host字段可以由程序自定义,所以host字段的值就会有很多特殊情况,如包含多个’/'字符的HOST头信息,结尾含有”.”等
http头中可以没有host字段吗?
在http 1.1中不能缺失host字段,如果缺失, 服务器返回400 bad request,http1.1中不能缺失host字段,但host字段可以是空值。
在http 1.0中可以缺失host字段。
RFC 2616中关于host字段的说明如下:
A client MUST include a Host header field in all HTTP/1.1 request messages . If the requested URI does not include an Internethost name for the service being requested, then theHost header field MUST be given with an empty value. An HTTP/1.1 proxy MUST ensure that any request message it forwards does contain an appropriateHost header field that identifies the service being requested by the proxy. All Internet-based HTTP/1.1 servers MUST respond with a 400 (Bad Request) status code to any HTTP/1.1 request message which lacks a Host header field.
转载请注明出处:6san.com原文地址: http://www.6san.com/463/
- http头中的host字段详解
- http头中的host字段详解
- http头中的host字段详解
- http头中的host字段详解
- http头中的host字段详解
- http头中的host字段详解
- http头中的host字段详解
- http头host字段详解
- 关于http请求头host字段中的port
- 关于http请求头host字段中的port
- HTTP中的Host字段
- HTTP头域字段详解
- HTTP头域字段详解
- HTTP头域字段详解
- java_Web14-Http响应头字段详解
- HTTP请求头中的refer字段
- javaWeb_12-Http请求头各个头字段详解
- HTTP实用头字段
- 驱动_IoCreateSymbolicLink错误,返回NTSTATUS错误码:C00003A
- 将Sun的Open Message Queue与Spring集成
- oracle ora-1555错误
- C#3.0新特性(三)- 详说自动属性和匿名类型
- PHP设计完美分页类
- http头中的host字段详解
- u-boot: _start, _armboot_start, .word等概念的理解
- Android屏幕选择
- net-snmp(5.7.2) install and test in linux
- HighCharts 详细使用及API文档说明
- java web 文件文件上传
- perforce 和 svn 的比较
- 在一个Activity里面结束另一个Activity
- android屏幕自适应研究