JakobGreen / lua-requests

Requests for Lua!
MIT License
217 stars 35 forks source link

How can I post a form data to a server? #8

Closed nerdneilsfield closed 8 years ago

nerdneilsfield commented 8 years ago

When I try to use requests.post(url,data) to post data to server , the server can't use form to extract data from postdata.

JakobGreen commented 8 years ago

requests.post{url=url, data=data} is the proper way to post data. The data field should be a string or an object. If the data is a string it will just send the string. If it is an object it will be JSON encoded and then posted. It doesn't do any form encoding.