[Laszlo-dev] dataset API for posting XML content
henry.minsky at gmail.com
Mon Mar 27 13:26:36 EST 2006
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 (
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
hminsky at laszlosystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Laszlo-dev