danwrong / restler

REST client library for node.js
MIT License
1.99k stars 389 forks source link

Custom xml2js options not provided to parser when directly calling the request() method #257

Open mbise1993 opened 6 years ago

mbise1993 commented 6 years ago

The parsers.xml.options object is only set in the shortcutOptions() method. However, when directly calling the request() method from client code, shortcutOptions() never gets called so the XML parser doesn't receive options set by the client. My fix for this was to change the first line in the request() method to: var request = new Request(url, shortcutOptions(options, options.method));

If you'd like, I can submit a PR with this change.

amitguptagwl commented 6 years ago

This project seems inactive from last 2 years. But you can have a look on https://www.npmjs.com/package/restler-base