[drakma-devel] http-request returns nil
Edi Weitz
edi at agharta.de
Thu May 29 22:09:32 UTC 2008
On Thu, 29 May 2008 17:33:05 -0400, "Andrei Stebakov" <lispercat at gmail.com> wrote:
> I wonder if response should be nil when content-length is 0?
The first return value of HTTP-REQUEST isn't necessarily a string, it
can also be an array of octets or a stream, so there's no particular
reason to assume that you'll get a string of length zero if the
content length is zero. But you can, no matter if it's a string, an
octet array, or NIL always check with LENGTH first.
One could argue that a zero-length array would be more appropriate,
but I think returning NIL in this case is more Lisp-y.
Having said that, I realize that NIL isn't even mentioned as a
potential return value, so I should probably add this to the
documentation.
More information about the Drakma-devel
mailing list