Loadrunner三种post格式的请求

Posted 时光

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Loadrunner三种post格式的请求相关的知识,希望对你有一定的参考价值。

Loadrunner三种post格式的请求
1 web_custom_request
intweb_custom_request(const char *RequestName, <List of Attributes>,
[EXTRARES, <List of Resource Attributes>,] LAST ); 

 第一种:自定义http格式的请求,可以是任何的方式或是body如下:

web_custom_request("xxxxx",

                            "URL=http://xxxx.xxxx.xxx",

                            "Method=POST",

                            "Resource=0",

                            "Snapshot=t10.inf",

                            "Mode=html",

                            "EncType=application/x-www-form-urlencoded",

                            "Body={\"sign\": \"{sign}\",\"token\": \"68C116cd449034db04C8ff2B7271B345\",\"time\": \"123456\",\"params\": {\"city_id\": \"2419\",\"advert_id\": \"2139\",\"offset\": \"0\",\"pagesize\": \"10\"}}",LAST);

 

2 web_submit_data 
intweb_submit_data(const char *StepName, const char *Action,<List of Attributes>, ITEMDATA, <List of data>, [ EXTRARES, <List of Resource Attributes>,] LAST ); 

第二种提交:支post和get请求. 
web_submit_data("pay_check.php",

         "Action=http://buyinterface.{url}/v1/pay_check.php",

                            "Method=POST",

                            "RecContentType=text/html",

                            "Snapshot=t7.inf",

                            "Mode=HTML",

                            ITEMDATA,

                            "Name=my_id", "Value={myid}", ENDITEM,

                            "Name=trade_no", "Value={trano_1}", ENDITEM,      

                            LAST);

3 web_submit_form.
intweb_submit_form(const char *StepName, <List of Attributes>, <List of Hidden Fields>, ITEMDATA, <List of Data Fields>, [ EXTRARES, <List of Resource Attributes>,] LAST );

第三种:只支持post请求

web_submit_form("db2net.exe",

    ITEMDATA,

    "name=library.TITLE", "value=Practical UNIX Security", ENDITEM,

    "name=library.AUTHOR_S_", "value=Garfinkel", ENDITEM,

    "name=library.SUBJECTS", "value=", ENDITEM,

    LAST );

 

以上是关于Loadrunner三种post格式的请求的主要内容,如果未能解决你的问题,请参考以下文章

关于loadrunner录制发送http请求的几种脚本格式

POST 请求的三种常见数据提交格式

loadrunner中get和post请求

性能测试Json脚本编写教程

Loadrunner在post请求的cookie中插入其它多个值

vue|axios发送post请求详解