我有一个返回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"
}
这可能吗?谢谢你的帮助。