luup.inet.wget return status

The Luup Lua Extensions page says of [tt]luup.inet.wget[/tt]:

This reads the URL and returns 2 variables: the first is a numeric error code which is 0 if successful...
Just tidying up some code and thought I should check the return status, and I find that this seems to be -1, although the HTTP request works just fine. Couldn't find anything useful from searching the forum. Any clues as to possible return values and their meanings? Thanks in advance!

Why not use socket.http as it will give you proper return codes.

  • Garrett

Ah, because I didn’t know about it! Something else to learn then, but not much, it appears, from this forum. A quite independent package from Luup, I gather. Any favourite reference documents?

Thanks!

You can do a search on “LuaSocket http”

Several of the plugins on code.mios.com use it also.

@guessed @garrettwp

Thanks both for your replies… searching is much easier when you know what terms to search for!

Good pointers in your own earlier post, @guessed:
[url=http://forum.micasaverde.com/index.php/topic,10793.msg75530.html#msg75530]http://forum.micasaverde.com/index.php/topic,10793.msg75530.html#msg75530[/url]

I found @futzle’s short but definitive post especially useful (as they usually are):
[url=http://forum.micasaverde.com/index.php/topic,12278.msg89713.html#msg89713]http://forum.micasaverde.com/index.php/topic,12278.msg89713.html#msg89713[/url]

It all confirms my earlier suspicion that [tt]luup.inet.wget[/tt] is certainly easiest, even if the return status is confusing (or just plain wrong).