【发布时间】:2017-05-04 11:30:17
【问题描述】:
以下是我用来发布简单请求的唯一代码。
urClient.post(url)
.header('Content-Type', 'application/json')
.header('Authorization', 'Bearer ' + token)
.end(
function (response) {
});
但现在需要使用 POST 调用发送复杂的 json 正文,如下所示:
{
"Key1": "Val1",
"SectionArray1": [
{
"Section1.1": {
"Key2": "Val2",
"Key3": "Val3"
}
}
],
"SectionPart2": {
"Section2.1": {
"Section2.2": {
"Key4": "Val4"
}
}
}
}
如何做到这一点?执行此操作的适当语法是什么?
【问题讨论】:
标签: javascript node.js unirest