如何使用Postman获取JSON密钥的值?

时间:2016-02-10 20:57:13

标签: json postman

我有一个返回JSON的API。使用Postman,我想发送一个返回密钥值的GET请求。

GET http://localhost/user/1将返回:

{
    "firstName": "First",
    "lastName": "Last",
}

我试过......

GET http://localhost/user/1.firstName 要么 GET http://localhost/user/1:firstName

{
    "error": "E_UNKNOWN",
    "status": 500,
    "summary": "Encountered an unexpected error",
    "raw": {
        "code": "ER_BAD_FIELD_ERROR",
        "errno": 1054,
        "sqlState": "42S22",
        "index": 0
    }
}

GET http://localhost/user/1?firstName将返回:

{
    "firstName": "First",
    "lastName": "Last",
}

我想发送类似GET http://localhost/user/1?firstName的内容返回:

{
    "firstName": "First"
}

这可能吗?谢谢你的帮助。

0 个答案:

没有答案