Forum Discussion
belltown
9 years agoRoku Guru
"ankitgaur" wrote:
We are confused about What should be the Request in the PostFromString() function. Any Solution with an example will be very helpful.
So, Could you Please provide an Example for this Scenario.
The 'request' parameter is the query string, the exact string you'd send after the "?" if you were doing a GET request. The Roku OS internally converts the query string parameters into "body parts".
You must also ensure that the query parameters are url-encoded, if necessary, e.g. using ifUrTransfer.Escape()
E.g.:
ut = CreateObject("roUrlTransfer")
ut.SetUrl("http://myserver.com/myscript.php")
...
queryString = ut.Escape(stuff) + "&" + ut.Escape(username) + "&" + ut.Escape(password)
ut.AsyncPostFromString(queryString)
...