Hi! I'm trying to use the LuaSocket library with the POST method to automate some web-based stuff. Try as I might, though, I can't find a full example of code using the POST method with LuaSocket, so I'm only half-aware of what I need to be doing.
My method at the moment is to http.request() the page containing the form I want to submit. I use some patterns to get the data out of this form, so I know the variables I need to be submitting and their values, as well as the page to submit them.
The problem comes with actually forming the query. I know that there's a second, optional parameter to http.request() that allows me to send POST data, and that I can also use the full syntax to specify the POST method and what data to send, but I have no idea what format the data should be in, and what it should look like. Table? String? What?
I'm aware as well that I also need to be setting the content type and content length - but I've no idea what those values should be, nor how to find them out. Any help with that would be vastly appreciated.
The specific site I'm trying to automate, by the way, is www.topmudsites.com's voting page. You can see an example voting page here: http://www.topmudsites.com/vote-revelate.html
Thanks!
My method at the moment is to http.request() the page containing the form I want to submit. I use some patterns to get the data out of this form, so I know the variables I need to be submitting and their values, as well as the page to submit them.
The problem comes with actually forming the query. I know that there's a second, optional parameter to http.request() that allows me to send POST data, and that I can also use the full syntax to specify the POST method and what data to send, but I have no idea what format the data should be in, and what it should look like. Table? String? What?
I'm aware as well that I also need to be setting the content type and content length - but I've no idea what those values should be, nor how to find them out. Any help with that would be vastly appreciated.
The specific site I'm trying to automate, by the way, is www.topmudsites.com's voting page. You can see an example voting page here: http://www.topmudsites.com/vote-revelate.html
Thanks!