How to post form data to URL

I have a few variable that I need to post to a remote server and get the response back from. Basically, I want to get the results back a server as if I had hit the submit button in the browser on a simple page like this:

MyParameter1:
MyParameter2:

Take a look at the http_post_from_string_with_timeout() function in the urlUtils.brs file in the videoplayer example.

Also the AsyncPostFromString() function of roURLTransfer: http://sdkdocs.roku.com/display/RokuSDK … ingrequest

How do I format the form fields into a single string?

url="http://www.gaiamtv-qa.gaiam.com/api/s/login?MyParameter1=foo&myparameter2=bar"

or

url="http://www.gaiamtv-qa.gaiam.com/aip/s/login?myparameter1="+myparameter1+"&myparameter2="+myparameter2

xfer=createobject("roURLTransfer")
xfer.seturl(url)
asyncpostfromstring("")

Of course you would need to set up a message port and wait loop to handle the async event results, and you would probably want to xfer.urlencode(parameter) before concatenating the variables into the post string.

  • Joel

hello
i want to send username and password in post form
i not found any right way to do it kindly help me.
i have username in one variable and password in other variable
and i have url so how i send request to the server in post form