lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


give a try to nutria: http://gitorious.org/nutria, it have extended support for making POST, is a library, so you can use it together with luasocket.

Blessings.

On Sat, May 29, 2010 at 9:35 PM, HyperHacker <hyperhacker@gmail.com> wrote:
On Sat, May 29, 2010 at 16:13, John Edwards <jedwards@numerix-dsp.com> wrote:
> Dear All,
>
> I would like to be able to use Lua to automate the submission of a web form
> E.G. :
>
> <form method="post" action="" href="http://formmail.pl" target="_blank">formmail.pl">
> <input name="body" value="" type="hidden">
> <input name="recipient" value="recipient@somedomain.com" type="hidden">
> <strong>Name : </strong><input size="40" name="realname" type="text"><br>
> <strong>Subject : </strong><input size="40" name="subject" type="text"><br>
> <input value="Submit" type="submit"></p>
> </form>
>
> I have seen luasocket but can't find any examples of how to use it to submit
> a form.
> I guess my first question should be is luasocket the correct technique and
> if so, how should I do it ?
>
> Please excuse my lack of knowledge of Lua but I am new to it and hoping to
> find a high level solution such as perl's WWW::Mechanize / LWP.
>
> Thank you very much,
>
> John
>
> PS if this is a FAQ please feel free to point me in the right direction.
>
>

LuaSocket can certainly do it, the same way you'd do it with any other
socket. Craft and send an HTTP POST request. Wikipedia would probably
tell you exactly how. There may be other libraries that make the job
easier, but HTTP is pretty simple.

--
Sent from my toaster.



--
Fernando P. García, http://www.develcuy.com
+51 1 9 8991 7871, Calle Santa Catalina Ancha #377, Cusco - Perú

** Before printing this message, please consider your commitment with the environment, taking care of it depends on you.
** Antes de imprimir este mensaje piensa en tu compromiso con el medio ambiente, protegerlo depende de tí.