how could i receive xml through a remote method in loopback?

360 Views Asked by At

I'm trying to create a remote method that accepts XML, i define my remote method like this,

WechatModel.remoteMethod('notify', {
    description: 'notify',
    accepts: [
      {
        arg: 'response',
        type: 'string',
        required: true,
        http: {
          source: 'body',
        },
      },
    ],
    http: {
      verb: 'post',
      path: '/notify',
    },
  });

then i changed my server/config.js like this:

"rest": {
  "normalizeHttpPath": false,
  "xml": true
},

but,i still got a string with the content "[object Object]"

0

There are 0 best solutions below