ServerVariables是ASP.NET下Request对象的一个集合,里面包含了客户端与服务器的信息
ALL_HTTP = 0,
ALL_RAW = 1,
APPL_MD_PATH = 2,
APPL_PHYSICAL_PATH = 3,
AUTH_TYPE = 4,
AUTH_USER = 5,
AUTH_PASSWORD = 6,
LOGON_USER = 7,
REMOTE_USER = 8,
CERT_COOKIE = 9,
CERT_FLAGS = 10,
CERT_ISSUER = 11,
CERT_KEYSIZE = 12,
CERT_SECRETKEYSIZE = 13,
CERT_SERIALNUMBER = 14,
CERT_SERVER_ISSUER = 15,
CERT_SERVER_SUBJECT = 16,
CERT_SUBJECT = 17,
CONTENT_LENGTH = 18,
CONTENT_TYPE = 19,
GATEWAY_INTERFACE = 20,
HTTPS = 21,
HTTPS_KEYSIZE = 22,
HTTPS_SECRETKEYSIZE = 23,
HTTPS_SERVER_ISSUER = 24,
HTTPS_SERVER_SUBJECT = 25,
INSTANCE_ID = 26,
INSTANCE_META_PATH = 27,
LOCAL_ADDR = 28,
PATH_INFO = 29,
PATH_TRANSLATED = 30,
QUERY_STRING = 31,
REMOTE_ADDR = 32,
REMOTE_HOST = 33,
REMOTE_PORT = 34,
REQUEST_METHOD = 35,
SCRIPT_NAME = 36,
SERVER_NAME = 37,
SERVER_PORT = 38,
SERVER_PORT_SECURE = 39,
SERVER_PROTOCOL = 40,
SERVER_SOFTWARE = 41,
URL = 42,
HTTP_CONNECTION = 43,
HTTP_ACCEPT = 44,
HTTP_ACCEPT_ENCODING = 45,
HTTP_ACCEPT_LANGUAGE = 46,
HTTP_HOST = 47,
HTTP_USER_AGENT = 48,
HTTP_UPGRADE_INSECURE_REQUESTS = 49
1.ALL_HTTP(由客户端发送的请求头,添加HTTP前缀)
//决定当前的事务完成后,是否会关闭网络连接
HTTP_CONNECTION:keep-alive
//客户端请求的时候,可以使用Accept字段声明自己可以接受哪些数据格式。
HTTP_ACCEPT:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
//客户端在请求时,用Accept-Encoding字段说明自己可以接受哪些压缩方法。
HTTP_ACCEPT_ENCODING:gzip, deflate, br
//请求头允许客户端声明它可以理解的自然语言,以及优先选择的区域方言。
HTTP_ACCEPT_LANGUAGE:zh-CN,zh;q=0.9
//指定服务器的域名,以及(可选的)服务器监听的TCP端口号
HTTP_HOST:localhost:4923
//User-Agent 首部包含了一个特征字符串,用来让网络协议的对端来识别发起请求的用户代理软件的应用类型、操作系统、软件开发商以及版本号。
HTTP_USER_AGENT:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36
//用来向服务器端发送信号,表示客户端优先选择加密及带有身份验证的响应
HTTP_UPGRADE_INSECURE_REQUESTS:1
2.ALL_ROW(由客户端发送的请求头,原生形态)
3.APPL_MD_PATH(检索应用程序的元数据路径)
/LM/W3SVC/8/ROOT
4.APPL_PHYSICAL_PATH(检索APPL_MD_PATH的元数据库路径对应的物理路径。)
D:\MyProject\XCYN\XCYN.Web\
5.HTTPS(如果请求通过安全通道(例如,SSL)进入,则返回,如果请求是针对不安全通道的,则返回。)
NO
6.LOCAL_ADDR(返回请求传入的服务器地址。这在计算机上很重要,因为在计算机上可以有多个IP地址绑定到计算机上,并且你想找出请求使用的地址。)
::1
7.PATH_INFO(路径信息,相对路径)
/Pages/test/RequestTest.aspx
8.PATH_TRANSLATED(PATH_INFO的物理路径信息)
D:\\MyProject\\XCYN\\XCYN.Web\\Pages\\test\\RequestTest.aspx
9.QUERY_STRING(查询字符串)
id=1&name=cheng
10.REMOTE_ADDR(正在发出请求的远程主机的IP地址。)
::1
11.REMOTE_HOST(正在发出请求的主机的名称)
::1
12.REMOTE_PORT(TCP连接的端口号)
1075
13. REQUEST_METHOD(用来发出请求的方法可以是GET,POST,PUT,DELETE等)
GET
14. SCRIPT_NAME(虚拟路径执行脚本的)
/Pages/test/RequestTest.aspx
15. SERVER_NAME(服务器的主机名、DNS别名或IP地址,因为它将出现在自引用URL中。)
localhost
16. SERVER_PORT(服务器端口号)
4923
17. SERVER_PROTOCOL(请求协议的名称)
HTTP/1.1
18. SERVER_SOFTWARE(服务器名称及版本号)
Microsoft-IIS/10.0
19.URL(对URL的基础部分,没有任何查询字符串或额外的路径信息)
/Pages/test/RequestTest.aspx