loadrunner Web_类函数之web_remove_auto_header()

来源:互联网 发布:淘宝付费推广技巧 编辑:程序博客网 时间:2024/06/07 02:57

web_remove_auto_header()--常用函数

停止脚本将特定标头添加到后续HTTP请求。

intweb_remove_auto_header(const char * Header,char * Implicit,LAST);

 

 参数说明:

object:评估到类型为WebApi的对象的表达式。通常是webfor Java和Visual Basic。另请参见函数和常量前缀。

Header:用户定义头的名称。

示例:Content-Type,If-Modified-Since,Referer和User-Agent。

Implicit:指示隐式头的处理的标志。可能的值为Yes,No和Cond,格式如下:“ImplicitGen = Yes / No / Cond”

是:生成隐式头,就像在发出任何web_add _auto_header函数之前一样。

否:根本不生成指定的头。

限制:仅当通过web_add _auto_header函数指定了此标头时,才生成隐式标头。这是默认值。

LAST:指示参数列表结束的标记。

 

一般信息:

web_remove_auto_header函数是一种服务函数,用于停止向后续HTTP请求添加特定的用户定义头。此函数取消由web_add_auto_header启动的指定头的自动生成头。

web_revert_auto_header函数等同于具有ImplicitGen选项设置为Yes的web_remove_auto_header函数。

所有Web脚本以及以HTTP或无线会话协议(WSP)重放模式运行的WAP脚本支持此功能。

 

示例:web_remove_auto_header

以下示例停止脚本将Accept-Encoding头添加到后续HTTP请求。 它继续生成隐式头。

web_add_auto_header(“Accept-Encoding”,“gzip”);

    ... ...

web_remove_auto_header(“Accept-Encoding”,“ImplicitGen= Yes”,LAST);

原创粉丝点击