如何从 Perl CGI 脚本发送 XML 数据?

发布于 2024-08-30 18:18:52 字数 236 浏览 1 评论 0原文

我没有 CGI 脚本或任何 Web 开发的经验。我正在开发一个客户端应用程序,只想有一个小的 CGI 脚本来发送和检索 XML 数据来测试我的客户端。

现在我正在执行 HTTP GET 来获取我需要的 XML 文件。现在,我正在更改我的客户端,以使用包含 XML 数据的请求执行 POST 并期望返回 XML。我想要一个小脚本,它只返回我已有的 XML 文件的内容。

任何人都可以向我指出有帮助的示例代码或 perl 模块吗?

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 sample code or perl modules that would help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

新一帅帅 2024-09-06 18:18:52

与您想要作为对 CGI 调用的响应发送的任何内容一样,选择正确的 MIME 类型并在消息正文中写入适当的数据。

既然你说你没有使用CGI的经验,那么尝试浏览一些CGI教程来熟悉该技术。 :)

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. :)

夏の忆 2024-09-06 18:18:52

我建议尝试一下 XML::Simple。

I would suggest giving XML::Simple a spin.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文