LoadRunner脚本-get&post请求

本文对比分析了GET和POST两种HTTP请求方式的具体实现方法。GET请求通常用于获取资源,其参数会显示在URL中;而POST请求则常用于提交数据到服务器进行处理,其参数放在请求体中发送。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

get请求

Action()
{





        web_custom_request("web_custom_request",
        "URL=http://locahost:8080/login.shtml?jsoncallback=password=000000&name=venture",
        "Method=GET",
        "Resource=0",
        "RecContentType=text/plain",
        "Referer=",
        "Mode=HTTP",
        "EncType=text/plain",

        LAST);


    return 0;
}

post请求



Action()
{




     web_add_header("cache-control","no-cache");    
     web_add_header("postman-token","8d0b8fd1-b65f-c90e-5317-8f29a465c8df");    
     web_add_header("token12","8d0b8fd129a465c8df");       
        web_custom_request("web_custom_request",
        "URL=http://locahost:8080/login.shtml",
        "Method=POST",
        "Resource=0",
        "RecContentType=text/plain",
        "Referer=",
        "Mode=HTTP",
        "EncType=text/plain",
        "Body=91XM+/ZteH7nO+cHOT8bpvK+FornV6Q==",
        LAST);


    return 0;
}

















评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值