lr测试json数据接口 请教问题 谢谢 !在线等
写的脚本如下:Action()
{
web_custom_request("request1"
"URL = http://61.145.165.154:8080/uc/json",
"Method = POST",
"Resource=1",
"RecContentType = uc/json",
"EncType = uc/json",
"Mode = HTTP",
RAW_BODY_START,
// "{action:\"DeviceActive\",device:{deviceid:\"abc\", devmodel:\"abc\"}}",
//"body = deviceid = b90f632d06cf51a176c36be73cb725d516d7c77f"
"{action:\"DeviceActive\", device:{deviceid:\"b90f632d06cf51a176c36be73cb725d516d7c77f\",devmodel:\"1\"}}",
//"{device:{deviceid:\"b90f632d06cf51a176c36be73cb725d516d7c77f\",devmodel:\"1\"}}"
//55,
RAW_BODY_END,
LAST);
//return 0;
}
运行报如下错:
Action.c(3): Error -27226: The "Method = POST" argument (number 2) is unrecognized or misplaced
Action.c(3): web_custom_request("request1URL = http://61.145.165.154:8080/uc/json") highest severity level was "ERROR", 0 body bytes, 0 header bytes 非要用RAW_BODY_START?
用一般的body=XXXX不就好了 但是这个数据很多的如"{action:\"DeviceActive\", device:{deviceid:\"b90f632d06cf51a176c36be73cb725d516d7c77f\",devmodel:\"1\"}}",
也可以吗? 应该怎样写的
回复 3# 的帖子
可以是可以的,可能会报参数找不到,最好把参数的左右边界{} 换成其他用不到的符号,或者连{}一起转义了试试 我把{}也转义了也不行的还是同样的错误
页:
[1]