A couple of people have asked recently about issues with sending XML as the payload of a POST
data request. We currently have a mechanism which works with proxied data requests where, if the magic
query param "lzpostbody" is added to a request, the server extracts that one value which is then sent to the back-end server verbatim as the only content of a POST request.

Ideally we ought to have a more flexible data API which allows you to send arbitrary strings at the content of a request, but  that is not permitted by the Flash platform as far as I can tell.

In DHTML, the XMLHTTPRequest API lets you send a String or XML DOM object as the payload. I don't know
if it allows arbitrary strings, or just well formed XML, I need to do some experiments. But if that works, we should implement the lzpostbody hack for that runtime. Or maybe we ought to have a cleaner API for this purpose.

The lzpostbody hack doesn't work in SOLO mode, because the Flash API call we are using now, LoadVars, doesn't support
sending just any arbitrary data as the payload; it expects to be given a hash table which it converts to a HTTP  form-encoded string (foo=bar&... ).

 If we use a Flash XML object (http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash_MX_2004&file=00001912.html )  to make the HTTP request instead of a LoadVars, then
we can at least post a well formed XML tree as the content.  It would still involve the expense of copying our LzDataElement tree into a Flash XML object (can be done fastest  by serializing it to a string and calling the Flash parser).







--
Henry Minsky
Software Architect
[EMAIL PROTECTED]

_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

Reply via email to