danwrong / restler

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

options.parser default value doesn't apply to request function (only get, post etc.) #192

Open mthx opened 9 years ago

mthx commented 9 years ago

The documented options.parser default value of restler.parsers.auto doesn't apply to the request function, but only get, post etc.

It is set in shortcutOptions which is only called from the method-specific functions.

I'm not sure whether the behaviour needs to change or just a hint in the README.md where under "Options" it says

parser A function that will be called on the returned data. Use any of predefined restler.parsers. See parsers section below. Defaults to restler.parsers.auto.

christophercurrie commented 9 years ago

Just ran into this today. The documentation could be more clear about how request doesn't behave like the other methods, in that options is a required argument, and there is no default parser. Even better, it would be nice for request to behave identically to the shortcut methods.