Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requests not working since changed to needle #112

Open
oscar-cbrlc opened this issue May 7, 2022 · 0 comments
Open

Requests not working since changed to needle #112

oscar-cbrlc opened this issue May 7, 2022 · 0 comments
Assignees
Labels

Comments

@oscar-cbrlc
Copy link

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.

@norberteder norberteder added the bug label May 8, 2023
@norberteder norberteder self-assigned this May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants