How can I send XML data from Perl CGI script?
I have no experience with CGI scripts or any web development. I'm developing a client app and just want to have a small CGI script to send and retrieve XML data to test out my client.
Right now I'm doing a HTTP GET to get the XML files I need. Now I'm changing my client to do POST with request containing XML data and expecting XML back. I want to have a small script that just returns the contents of an XML file that i already have.
Can anybody please point me to samp开发者_如何学Gole code or perl modules that would help.
As with anything you want to send as a response to a CGI invocation, select the right MIME type and write the appropriate data in the message body.
Since you say that you have no experience with CGI, try looking through some CGI tutorials to get acquainted with the technology. :)
I would suggest giving XML::Simple a spin.
精彩评论