The URL update worked for me, but other users have said it didn't work for them. I noted that getheaders (according to the request recorded in the response object) was retrieving a user agent from the form. That form may differ between node-red versions, so I decided to include it to be on the safe side. I could not test that it worked however, because I couldn't make it fail in the first place.
Another repo used a user agent derived from android, but I decided to keep it honest and make the user agent be the name of this module.
I also added error.response.data.errorMessage to the error message. Ideally, I would optionally include it based on whether its defined, but I think if it's not, as I found out through trial and error, if it doesn't exist, it will just print "undefined".
Resolves issue #16
The URL update worked for me, but other users have said it didn't work for them. I noted that getheaders (according to the request recorded in the response object) was retrieving a user agent from the form. That form may differ between node-red versions, so I decided to include it to be on the safe side. I could not test that it worked however, because I couldn't make it fail in the first place.
Another repo used a user agent derived from android, but I decided to keep it honest and make the user agent be the name of this module.
I also added error.response.data.errorMessage to the error message. Ideally, I would optionally include it based on whether its defined, but I think if it's not, as I found out through trial and error, if it doesn't exist, it will just print "undefined".