我正在使用Mozilla fire fox
加载项RESTClient
来测试我的网络服务。到目前为止,我通过在请求正文中设置标题POST
和Content-Type:application/x-www-form-urlencoded
分隔的数据来使用&
方法,例如id=1&title=abc
但是现在我希望POST
JSON
对象使用相同的服务。示例对象如下:
[
{
"id": 4
"type":"alpha",
"title":"Title1"
}
]
OR
[
{
"id": 4
"type":"alpha",
"title":"Alpha"
},
{
"id": 5
"type":"beta",
"title":"Beta"
},
{
"id": 6
"type":"gama",
"title":"Gama"
}
]
OR
[
{
"id": 5,
"type":"beta",
"title":"Sample beta",
"children":[{
"id": 6,
"type":"betachild",
"title":"Beta child 1"
},
{
"id": 7,
"type":"betachild",
"title":"Beta child 2"
},
{
"id": 8,
"type":"betachild",
"title":"Beta child 3"
}
]
}
]
OR
[
{
"id": 5,
"type":"beta",
"title":"Sample beta",
"children":[{
"id": 6,
"type":"betachild",
"title":"Beta child 1"
},
{
"id": 7,
"type":"betachild",
"title":"Beta child 2"
},
{
"id": 8,
"type":"betachild",
"title":"Beta child 3"
}
]
},
{
"id": 9,
"type":"beta",
"title":"Sample gama",
"children":[{
"id": 10,
"type":"gamachild",
"title":"Gama child 1"
},
{
"id": 11,
"type":"gamachild",
"title":"Gama child 2"
},
{
"id": 12,
"type":"gamachild",
"title":"Gama child 3"
}
]
}
]
如何使用JSON
插件在POST
请求中传递此RESTClient
个对象?