[luci] What about luasrc/httpclient.lua?

Jan Lühr ff at stephan.homeunix.net
Wed Feb 13 22:38:23 CET 2013


Hello,

Am 13.02.2013 um 22:23 schrieb Bryan Mayland:

> On 2/13/2013 4:12 PM, Jan Lühr wrote:
>> Thanks for your reply. However, I'm still stucked at constructing the body. As far as I got, request_raw  does not provide any routines for building  multipart/form-data chunks. If I supply all data in a table, it'll be url-encoded (which is bad for larger binary files).
>> 
>> Are you aware of any higher-level routines using request_raw(.)? Constructing HTTP-Request bodies by hand seem to be rather error-prone (imho)  - actually, that's why I'm looking for a http-client library.
>> 
> You can have a look at what the Fonera people do with their "uploadd" library, which is a file uploader (to facebook, youtube, picasa, etc) that uses httpclient. You can specify that your content encoding is binary for the mime chunk and then use a callback function to just stream the data from file to the HTTP connection.
> 
> http://svn.fonosfera.org/fon-ng/trunk/luci/libs/uploadd/luasrc/fon/

Thanks for your reply - their code looks rather strange (constructing xml as Strings in controller-style code looks confusing). Sadly, this stuff seems to be harcoded in their library :-/

Keep smiling
yanosz



More information about the luci mailing list