If your XUL app has chrome privileges, then there are netwerk interfaces that can be used to issue POST requests (see nsIUploadChannel). However, this interface is not yet frozen, so writing applications that depend on this interface is probably not a good idea. I think XMLHttpRequest is probably the best way to achieve what you're looking for. However, XMLHttpRequest does have same origin security limitations that can be dealt with in a variety of ways (either run your JS w/ chrome privileges or use signed JS).
Darin Brendan Eich wrote: > Micah Yoder wrote: > >> Ok what's the deal here.... >> >> I got all excited about switching all my web development to XUL, and >> having it communicate with server-side PHP scripts to do the database >> work. >> >> I spent much of this week inhaling _Creating_Applications_With_Mozilla_, >> which is excellent as far as it goes (thanks guys). But to my horror it >> didn't have an example of doing an HTTP Post from Javascript based on XUL >> widgets! >> >> The book talks about SOAP, which I'd really rather not deal with. >> >> I did a Web and Usenet search for this and came up with very little. >> There's XMLHttpRequest, but it's apparently only in nightly builds -- I >> want my app to work with Mozilla 1.0+ and NS7, out of the "box", without >> the user having to install extra junk. Plus, it looks to be >> overcomplicating things. All I want to do is construct a POST, submit it >> to a server, and read and parse the server's response from JavaScript so >> it can then do fun things with the DOM to make the user think they >> accomplished something. >> >> SURELY this is possible! PLEASE tell me I missed something! If >> something as basic as an HTTP Post can't be done from XUL/Javascript, we >> have problems! >> >> > > You're asking in the wrong group -- I'm trying m.dom and m.netlib, with > followups-to: netlib, and cc'ing darin and dougt, who prolly know the > scriptable interface to use. > > /be > >> Thanks, >> Micah >> >> >> > >
