Buffer #43

Closed
TheeTDot opened this Issue Dec 4, 2013 · 7 comments

2 participants

@TheeTDot

When I send a POST request I'm getting back a Buffer in the request body. How do I handle this?

{ ...
resume: [Function],
read: [Function],
bytes: 0,
body: < Buffer > }

@tomas
Owner

It's a string or binary buffer, depending on what you requested. In most cases you'd just do response.body.toString().

Is that what you mean?

@TheeTDot

Well the problem is that I know for sure that the request should take 3 to 5 minutes to get a response and this is what I get after 20 seconds; as if it is prematurely timing out. (even if timeout option is set to 0).

@tomas
Owner

And what do you get with console.log(resp.body.toString()); ?

I can see that the response is empty (0 bytes) though. Unless the first argument is an Error, it means that the request was successful.

@TheeTDot

The request I'm sending creates virtual machines and the response has the credentials. I've just run out off space though and I don't have the permissions to delete; so I'll have to test again tomorrow.

@tomas
Owner

Sure, let me know if there's any way I can help.

@tomas
Owner

Hi, were you able to take a look at this?

@TheeTDot

Yes I did. It seemed to be a problem with the external service; not Needle.

@TheeTDot TheeTDot closed this Mar 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment