【发布时间】:2018-05-27 12:59:01
【问题描述】:
var request = require('request');
request.post(
'http://www.yoursite.com/formpage',
{ json: { key: 'value' } },
function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body)
}
}
);
但我的问题是不知道如何解析和调整代码。
"entities": [
{
"entity": "today",
"type": "builtin.datetimeV2.date",
"startIndex": 0,
"endIndex": 4,
"resolution": {
"values": [
{
"timex": "2017-12-13",
"type": "date",
"value": "2017-12-13"
}
]
}
}
]
}
我想从这个 JSON 中得到的值是今天的实体。
如何调整代码以提供我想要的确切实体?
【问题讨论】:
-
你应该试一试。参考:stackoverflow.com/q/17811827/1531971 和许多其他人通过网络搜索找到。
-
你
JSON.parse了吗?