接口性能测试脚本调测不通过,菜鸟求助,急! 谢谢好心人
脚本:Action()
{
web_custom_request("AddUser",
"URL=http://10.132.110.11:8080/test/user/create",
"Method=POST",
"TargetFrame=",
"Resource=0",
"Referer=",
"Body={"
"\"version\":1.00,"
"\"sysId\":1,"
"\"userId\":0,"
"\"signId\":\"12345\","
"\"data\":{ \"loginName\":\"test001\","
"\"email\":\"test001@163.com\","
"\"name\":\"test001\","
"\"password\":\"e10adc3949ba59abbe56e057f20f883e\","
"\"mobile\":\"13700000001\","
"\"phone\":\"02588888888\","
"\"status\":\"active\""
"}"
"}\"",
LAST);
return 0;
}
调测报错如下:
正在开始操作 Action。
Action.c(4): 错误 -26631: 对于“http://10.132.110.11:8080/test/user/create”,HTTP 状态代码=400 (Bad Request)
Action.c(4): web_custom_request("AddUser") 最高严重级别为“ERROR”,1043 个正文字节,172 个标头字节
正在结束操作 Action。
原正确的请求消息体是:
{
"version":1.00,
"sysId":1,
"userId":0,
"signId":"12345",
"data":{ "loginName":"test001",
"email":"test001@163.com",
"name":"test001",
"password":"e10adc3949ba59abbe56e057f20f883e",
"mobile":"13700000001",
"phone":"02588888888",
"status":"active"
}
} 函数使用不是很正确 你要把参数化边界给改一下不要用{} 函数使用应该是没有错吧云层大师???
另外是好像就是最后的"}\"",是否应该修改为"}",就对了。 谢谢各位楼主的热心帮助。问题解决了,是 xzf2001所说的 最后的"}\"" 修改为"}"就OK了,我原来想着这里添加一个 " 与body前面的"匹配的,原来不需要,只需要每行的消息内容用 " "括起来就好了
页:
[1]