节点'request'包,获取字符串而不是对象

时间:2017-07-20 11:43:40

标签: json node.js npm-request

let url = 'https://www.example.com';
let requestData = {
    "key": {
        "keyA": "value",
    }
};
let options = {
    url: url,
    method: "POST",
    headers: {
        "Content-Type": "application/json",
    },
    json: requestData
};
request(options, function(err,httpResponse,result){});

我怎样才能将结果作为字符串而不是对象?

0 个答案:

没有答案