Tag: 节点请求

将JSON传递给HTTP POST请求

我正在尝试使用nodejs和request [2]向Google QPX Express API [1]发出HTTP POST请求。 我的代码如下所示: // create http request client to consume the QPX API var request = require("request") // JSON to be passed to the QPX Express API var requestData = { "request": { "slice": [ { "origin": "ZRH", "destination": "DUS", "date": "2014-12-02" } ], "passengers": { "adultCount": 1, "infantInLapCount": 0, […]