lr做接口测试post不过去数据求解
lr做接口测试post不过去数据求解,回放成功了,但经和开发调试,post过去的数据是空的,有哪位知道我这个是哪里出问题了,脚本如下:Action()
{
web_add_header("Content-Type","application/json;charset=UTF-8");
web_submit_data("web_submit_data",
"Action=http://192.168.0.150/prod/prodContent",
"Method=POST",
"TargetFrame=",
"Referer=",
"Mode=HTTP",
ITEMDATA,
"Name=requestJson", "Value={\"head\":{\"version\":\"1.0.0\",\"code\":\"dahongwaapp\",\"timestamp\": 1438161369743},\"body\": {\"prodId\": \"20020\"}}", ENDITEM,
EXTRARES,
"URL=http://192.168.0.150/prod/prodDetail", "Referer=http://192.168.0.150/prod/prodDetail", ENDITEM,
LAST);
return 0;
}
运行日志如下::
Starting action Action.
Action.c(4): Warning -26593: The header being added may cause unpredictable results when applied to all ensuing URLs. It is added anyway
Action.c(4): web_add_header("Content-Type") highest severity level was "warning"
Action.c(5): Downloading resource "http://192.168.0.150/prod/prodDetail" (specified by argument number 12)
Action.c(5): web_submit_data("web_submit_data") was successful, 172 body bytes, 341 header bytes, 22 chunking overhead bytes
Ending action Action.
Ending iteration 1.
已搞定,是开发给的接口有问题,坑死了 :L 那确实有点坑
页:
[1]