我需要在POSTMAN中将参数作为对象数组发送.
"array": [
{"field1": "html", "field2": "5"},
{"field1": "css", "field2": "3"}
]
Run Code Online (Sandbox Code Playgroud)
我知道数组必须发送为array[]但是如何将数组的一个项目设置为对象?
我试过这个
"array[]" : "{"field1": "html", "field2": "5"}"
Run Code Online (Sandbox Code Playgroud)
但是我收到了500回复错误.
同事!
有时我在代码中有一个很长的字符串,例如一个字符串中有超过 200 个符号。
我可以在 Robot Framework 代码中对新行进行一些跟踪吗?
感谢您的关注!
我有一个示例回复:
{
"tags": [
{
"id": 1,
"name": "[String]",
"user_id": 1,
"created_at": "2016-12-20T15:50:37.000Z",
"updated_at": "2016-12-20T15:50:37.000Z",
"deleted_at": null
}
]
}
Run Code Online (Sandbox Code Playgroud)
我已经为响应写了一个测试:
var schema = {
"type": "object",
"properties": {
"tags": {
"type": "object",
"properties": {
"id": { "type": "integer" },
"name": { "type": "string" },
"user_id": { "type": "number" },
"created_at": { "type": "string" },
"updated_at": { "type": "string" },
"deleted_at": { "type": ["string", "null"] }
}
}
}
};
var data = JSON.parse(responseBody);
tests["Valid schema"] = tv4.validate(data, schema);
Run Code Online (Sandbox Code Playgroud)
此测试返回[FAIL].测试中有什么错误? …