Hi all,
I've been working on a lua-resty-http implementation recently, and since this seems to be coming up on the list more and more often, I thought it sensible to share.
I started where Brian left off with lua-resty-http-simple, extending it with a more complete and generic "cosocket" interface, and adding support for streaming the response body with an iterator. I kept a "simple" URI based interface similar to Brian's, which just wraps the generic one.
It's passing tests, so for most cases I would imagine you can just drop this in and start using it. I'm not running it in production just yet - though it'll be tested amongst our other apps soon to see if this exposes any issues. First I thought it would be good to get feedback on the design / interface before setting it in stone.
The main thing I wanted to achieve was streaming response bodies into Lua, regardless of whether they were encoded as chunked or not, for obvious memory management reasons. More generally it's been said before that we need a "blessed" resty-http module, so if anyone has any criticisms / suggestions / patches I'm all ears!
Cheers,
James.