I’m trying to dip my toes into Ajax, and am attempting to give an XML
reply to the query. And I am completely failing – either it gets
passed, but with an HTML MIME header (which is why I’m guessing it’s not
recognized by the client as XML), OR it barfs and gives a 500-series
server-side error. Here’s what the pertinent code currently looks like
– it’s been through many permutations, but has never quite been right
enough, so I assume I’m doing something dumb:
#!/usr/bin/ruby
require ‘cgi’
comics =
cgi = CGI.new(“html3”) # add HTML generation methods
if(cgi[‘action’]==“foo”)
cgi.out(“application/xml”){
comics.to_xml
}
exit
else
other stuff here
I have a sneaking suspicion I’m completely missing some obvious
point… but darned if I know what. Any pointers?
Thanks much!
-Ken