我正在使用Node.js中的请求模块来执行put请求.我的代码看起来像这样
var request = require('request'); var data = {foo: "bar", woo: "car"}; request({ method: 'PUT', uri: myURL, multipart: [{ 'content-type':'application/json', body: JSON.stringify(data) }] }, function(error, request, body){ console.log(body); });
当我运行这个时,我收到一个错误:
"不支持的内容类型:application/json"