Hey Isa - nice article! I think you picked the three ways I'd recommend for using an http client in Node.
A thought about the benchmarking of the the Node built in http lib: have you tried building a different data structure than a string - some sort of byte buffer - and then turning it into a string at the end. I'm not sure but I think it might be (I'm away from my computer so I can't try it myself).
Hi David, thank you for the feedback! I'm looking into byte buffers (am I seeing this is originally a Java data structure?) for JavaScript, and I'm falling down a rabbit-hole about ArrayBuffers, Uint8Arrays, etc. I found my way over to the npm package bytebuffer (npmjs.com/package/bytebuffer), which looks like it provides a friendly API for using those structures.
I'm running up against a challenge of understanding how best to theoretically write to a byte buffer with incoming http request data--from this list of byte-buffer-writing options (github.com/protobufjs/bytebuffer.j...), do you have any advice on where I should be looking? I'm not sure which option will be more efficient than simply coercing the incoming data into a string.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey Isa - nice article! I think you picked the three ways I'd recommend for using an http client in Node.
A thought about the benchmarking of the the Node built in http lib: have you tried building a different data structure than a string - some sort of byte buffer - and then turning it into a string at the end. I'm not sure but I think it might be (I'm away from my computer so I can't try it myself).
Hi David, thank you for the feedback! I'm looking into byte buffers (am I seeing this is originally a Java data structure?) for JavaScript, and I'm falling down a rabbit-hole about ArrayBuffers, Uint8Arrays, etc. I found my way over to the npm package bytebuffer (npmjs.com/package/bytebuffer), which looks like it provides a friendly API for using those structures.
I'm running up against a challenge of understanding how best to theoretically write to a byte buffer with incoming http request data--from this list of byte-buffer-writing options (github.com/protobufjs/bytebuffer.j...), do you have any advice on where I should be looking? I'm not sure which option will be more efficient than simply coercing the incoming data into a string.