12.Filters
下面的选项都是帮助关联返回限定的,通过这些设置可以进一步减少返回的范围。
13.Scope
该项设置关联查询的范围,在LR11中和以前的范围做了一些调整,应该算是更加强大了,这里Scope提供了4个选项:Body、Headers、Cookies、All。
1)ALL
比较容易理解,就是让服务器的返回所有内容作为需要关联的目标来处理。
2)Headers/Body/Cookies
这3个选项都是从请求返回的所有内容进行关联处理,包括图片、JavaScript脚本等。区别在于对返回信息的分隔方式。在前面介绍HTTP的时候介绍过HTTP返回的内容其实是由Header(HTTP信息头)和Body(HTTP内容)组成的,而Cookie又是Header中的一部分,在Tree模式下的HTTP View视图中可以清晰地看到LR如何定义各块内容。当我们对Phpwind登录返回做关联时,不同的Scope带来的效果如下。
3)Header
指所关联的内容是所有服务器返回请求的HTTP头部分内容。可以通过查看服务器返回内容来了解,Body之前的内容都属于Header:
Action.c(16): Notify: Saving Parameter "temp = HTTP/1.1 200 OK\r\nDate: Wed, 05 Oct 2011 04:53:51 GMT\r\nServer: Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1\r\nX-Powered-By: PHP/5.3.5\r\nSet-Cookie: 53d97_lastvisit=0%091317790431%09%2Fphpwind85%2Flogin.php; expires=Thu, 04-Oct-2012 04:53:51 GMT; path=/\r\nSet-Cookie: 53d97_lastpos=other; expires= Thu, 04-Oct-2012 04:53:51 GMT; path=/\r\nSet-Cookie: 53d97_lastvisit= 0%091317790431%09%2Fphpwind85%2Flogin.php; expires=Thu, 04-Oct-2012 04:53:51 GMT; path=/\r\nSet-Cookie: 53d97_winduser=VgEDATtTUVZRVQ8HUFcEVg4JUFQBAQFVVlRVUgBXUVIJAQ8AVT4; path=/; httponly\r\nSet-Cookie: 53d97_ck_info=%2F%09; expires=Thu, 04-Oct-2012 04:53:51 GMT; path=/\r\nSet-Cookie: 53d97_lastvisit=deleted; expires=Tue, 05-Oct-2010 04:53:50 GMT; path=/\r\nSet-Cookie: 53d97_regactivate=deleted; expires=Tue, 05-Oct-2010 04:53:50 GMT; path=/\r\nContent-Encoding: gzip\r\nContent-Length: 7217\r\nKeep-Alive: timeout=5, max=100\r\nConnection: Keep-Alive\r\nContent-Type: text/html\r\n\r\n". |
在Header中还能进行二次过滤,填写Header Name,默认值为Undefined 。如果我只想知道服务器返回Header中的Server服务器信息,那么在Header Name中填写Server即可:
Action.c(16): Notify: Saving Parameter "temp = Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1". |
4)Body
就是服务器返回在Body以后的内容:
Action.c(16): Notify: Saving Parameter "temp = <!doctype html>\r\n<html>\r\n<head>\r\n<meta charset="utf-8" />\r\n<title>鎻愮ず淇℃伅 - Powered by phpwind</title>\r\n<meta http-equiv="refresh" content="1;url=http://localhost:8000/phpwind85/index.php">\r\n<SCRIPT type="text/javascript"language="JavaScript" src="js/core/core.js"></SCRIPT> …略 |
5)Cookie
指Header部分关于Cookie定义的部分内容。
Action.c(16): Notify: Saving Parameter "temp = 53d97_lastvisit=0%091317790561% 09%2Fphpwind85%2Flogin.php; expires=Thu, 04-Oct-2012 04:56:01 GMT; path=/". |
14.Request URL
这里提供了针对URL地址的过滤方式来减少关联范围,例如,我们可以填写*.php来说明只对PHP页面进行过滤。
15.Content Type
回顾我们在讲录制下载操作的时候,提到了Content Type这个概念,这样在录制的时候可以通过这个特性来过滤录制对象。而在关联这里,这个属性的效果是相同的,在网站应用中,我们要关联的内容一般都存放在HTML页面中,所以这里我们通常都是用text/html来作为Content Type过滤规则的。