couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <j...@couchbase.com>
Subject Re: A Simple REST API
Date Tue, 12 Nov 2013 02:08:02 GMT

On Nov 11, 2013, at 5:40 PM, Sébastien Durand <se8.and@gmail.com> wrote:

> It's just a dead simple draft, it works, but what are the drawbacks ? Do I
> put myself in trouble ? (I don't have a deep tcp/http background and I fear
> it's not that simple.)

It’s not that simple. HTTP isn’t rocket science but it has a lot of details and some subtleties.
You do NOT want to go about re-implementing an HTTP client on your own. It’s going to be
a big pain in the ass and get in the way of what you really want to do. And Ruby already has
perfectly good HTTP support.

Just off the top of my head, your code will break with redirects, chunked-mode responses or
gzip encoding, and it doesn’t support keep-alive. If you added code to parse the response,
I could probably find six or seven other things that didn’t do. I’m not trying to be harsh,
but I've spent a decade working closely with HTTP and I know the pitfalls.

—Jens
Mime
View raw message