Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Data Integration / August 2005



Tip: Looking for answers? Try searching our database.

posting url params, receiving xml

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rudgr - 20 Aug 2005 14:53 GMT
I want to be able to post parameters to a url and get the response of the url
as XML.

What's the best way to achieve this?

I experimented using the script below, this seems to post the parameters
allright, but the content of lvReceipt is urlencoded. How can I unescape this
and parse it as xml?

or is there a better solution for this problem?

var lvSender:LoadVars = new LoadVars();
var lvReceipt:LoadVars = new LoadVars();
   
lvReceipt.onLoad = function():Void {
    ctaMessage.text = this;
}
   
lvSender.NAME = ctiName.text;
lvSender.SUBJECT = ctiSubject.text;
lvSender.EMAIL = ctiEmail.text;
lvSender.MESSAGE = ctaMessage.text;
lvSender.sendAndLoad("http://www.domain.tld/return_some_xml.asp",lvReceipt);

Thanks!
perry - 22 Aug 2005 07:07 GMT
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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.