post command on Android not working (?)
Nicolas Cueto
niconiko at gmail.com
Thu Mar 8 10:28:35 EST 2012
> You're right, this doesn't work. It is a bug.
Mark,
That got me thinking that there might be a bug report on this already.
And there is! Report# 9964.
That report offers this workaround:
----------------------------------------
I can confirm there is a bug in Android "post to URL". The post data is
transmitted to the server, but the Content-Type header is not being set. By
default, the Content-Type header should be set to
"application/x-www-form-urlencoded" but this is not being done.
As a workaround, you can set this header manually using the httpHeaders
property:
set the httpHeaders to "Content-Type: application/x-www-form-urlencoded"
You should set the httpHeaders to empty once the post command has completed to
avoid it affecting any subsequent url access.
-----------------------------------------
That bug report also states this bug has been fixed for 5.5.0-dp-1.
But, apparently it hasn't. At least, not on 5.5.0-dp-2.
So, I tried that "set the httpHeaders" workaround. Also not working.
Here's something else very odd that's happened after further experimentation.
If on my stack I >>first<< click a button with this script:
get url get url ("http://www.google.com")
put it into field "text"
and then after that click the button with the "post (plus workaround)" script:
set the httpHeaders to "Content-Type: application/x-www-form-urlencoded"
put URLEncode(tQueryFormat) into tQueryFormat
put URLEncode("http://helloWorld.cgi") into tURL
post tQueryFormat to URL tURL
put it into field "text"
that second "it" contains the google.com page's data.
And I tried that "get url" with a different url, and the same odd
result happened.
So, whereas in my first post, "it" was returning empty, now "it"
contains pre-fetched data.
Guess that bug report ought not to be resolved as "Fixed"?
--
Nicolas Cueto
More information about the use-livecode
mailing list