节点JS请求 – 承诺POST方法不能识别一个string

为了连接我的node.js模块与另一台服务器,我使用'request-promise'库。 当我想发布这样的东西:

rp.({ method: 'POST', headers:{ 'Content-Type': 'text/plain', 'Authorization': '' }, uri: 'https://myendpoint.com', body:{ name: 'here is my a name', code: 'here is my code', location: 'here is my location' } }).then(...) 

但总是当我尝试使用这个function,我得到这样的错误信息:

  RequestError: Error: Argument, error, options.body. TypeError: First argument must be a string or Buffer 

我所有的身体参数都是string。 此外,我也尝试了相同的邮递员方法,并为我工作。 那么我做错了什么?