well,
LoadVars Object sends and loads url-encoded,
XML Object sends and loads xml.
what i do when i want to send a querystring and receive xml is building the
querystring manually like:
myXML.load("some.asp?var1="+var1+"&var2="+var2); //etc.
works great!
perry
> I want to be able to post parameters to a url and get the response of the url
> as XML.
[quoted text clipped - 18 lines]
> lvSender.EMAIL = ctiEmail.text;
> lvSender.MESSAGE = ctaMessage.text;
lvSender.sendAndLoad("http://www.domain.tld/return_some_xml.asp",lvReceipt);
> Thanks!
rudgr - 22 Aug 2005 09:18 GMT
Hi perry, thanks for the reply.
I think XML.load sends the request using HTTP GET.
I need the url parameters to be send using HTTP POST.
Is this also possible?
perry - 22 Aug 2005 11:05 GMT
well, not possible i think.
so things start getting difficult at that point.
you´ll have to create an xml object in flash, populate it with the vars,
send it to the server, disassemle the xml on the server with asp and
generate xml output.
it´s not too complicated, but unusual.
don´t know any other/better way if you have to stick to POST.
perry
rudgr - 22 Aug 2005 11:14 GMT
Hi Perry,
the problem is that the script i'm posting to is also used with plain htlm
forms.
When using the scipt I first suggested the parameters are posted to the URL,
but since the xml response of the asp page was loaded in a receiving loadVars
object, the xml itself was url encoded. Is there a simple way to url decode the
xml string and then load it into a XML object?
perry - 22 Aug 2005 11:56 GMT
if i get you right you have a variable from loadvars which is url-encoded.
so you depend on a predefined asp you can´t edit yourself?
you could try the unescape() function in flash.
xml = unescape(url_xml).
else you could do a split/join thing for each character to be replaced.
xml = url_xml.split("%20).join(" "); // for each encoded character.
depending on the encoding you might want to use
System.useCodePage=true;
huh, quite some workaround needed here!
perry
> Hi Perry,
>
[quoted text clipped - 5 lines]
> object, the xml itself was url encoded. Is there a simple way to url decode the
> xml string and then load it into a XML object?