-
Notifications
You must be signed in to change notification settings - Fork 251
Description
Hi, I've been trying to use your project for making requests and noticed that none of the functions work (tried with addCard
, addBoard
, getCardsOnBoard
, so it might be the same for the rest of them), however the tests pass.
So, making tests and comparing to a previous version, I realized that the method makeReqest
calls completeCallback
once the request method (put, post, delete ...) returns a ReadableStream event "complete".
fn(uri, options).once('complete', completeCallback);
But this only exists in restler:
complete: function(result, response)
- emitted when the request has finished whether it was successful or not. Gets passed the response result and the response object as arguments. If some error has occurred, result is always instance of Error, otherwise it contains response data.
I looked at the documentation for needle, and found an almost equivalent event:
done
(previously 'end') - Emitted when the request/response process has finished, either because all data was consumed or an error ocurred somewhere in between. Unlike a regular stream's end event, Needle's done will be fired either on success or on failure...
I tried just replacing it, but this are different events in core, so it doesn't even get triggered, and I think the params passed as arguments are different as well...
So I suggest either going back to restler or maybe find a way to fix this with needle.