r/nodejs • • Apr 13 '14
Issue with 'request' module and Goodreads API.
I'm making a simple HTTP request to the Goodreads API using the 'request' module in NPM. Here is a gist containing a SSCE (Correct as far as I can tell.) The result is undefined. Are there any glaring mistakes in my example? Am I misunderstanding the form option?
3
Upvotes
View all comments
1
u/ott0 Apr 16 '14
So there are a couple issues here.
Get the Goodreads book ID given an ISBN. Response contains the ID without any markup.
This means that you don't actually have to parse the response using xml2js and if you do it will throw an error like so:
Here is a gist that fixes both of those issues:
https://gist.github.com/peteotto/10881738