Mozilla休息客户端发布json对象

时间:2015-05-11 12:28:29

标签: mozilla rest-client

我正在使用Mozilla fire fox加载项RESTClient来测试我的网络服务。到目前为止,我通过在请求正文中设置标题POSTContent-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个对象?

0 个答案:

没有答案