danwrong / restler

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

"complete" event triggers twice #155

Open crtag opened 10 years ago

crtag commented 10 years ago

In this simple scenario:

restler.get(url)
        .on(
            'complete',
            function(data, resO) {
                console.log(data);
            }
        );

console is used twice, first time with error, which is irrelevant and was tested against possible server side issue

{ [Error: Parse Error] bytesParsed: 246, code: 'HPE_INVALID_CONSTANT' }

and null on the second time

null

which is not correct as well.

airyland commented 10 years ago

me too!

leoliew commented 7 years ago

me too!
is look like register two listener

wwELi commented 6 years ago

me too too!