获取HTTP内容

时间:2014-08-26 15:32:38

标签: javascript http http-headers

当我访问pwd.html时,这是我的Http标题跟踪

host:port/pwd.html?type=Msg=8

POST /pwd.html?type=Msg=8 HTTP/1.1
Host: host:port
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: anotherhost:port/referrer
Cookie: SomeCookie=loggedoutcontinue; targetURL=Someurl
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 4936
  APP_REQ=324823823


HTTP/1.1 200 OK
Date: Tue, 26 Aug 2014 15:05:29 GMT
Server: Application-Server
Last-Modified: Mon, 25 Aug 2014 18:55:15 GMT
Accept-Ranges: bytes
Content-Length: 1336
Keep-Alive: timeout=5, max=99
Connection: Keep-Alive
Content-Type: text/html
Content-Language: en

如何使用Javascript从我的pwd.html中读取APP_REQ的值?它不是查询字符串或URL的一部分,但它是请求的一部分。

1 个答案:

答案 0 :(得分:0)

除非服务器将此值包含在pwd.html本身的内容中,否则这是不可能的。这需要像PHP或Node.js这样的服务器端。