如何获取 Catalyst 中的所有请求参数?

发布于 2024-08-11 01:40:34 字数 156 浏览 1 评论 0原文

具体来说,我试图从支付网关捕获所有 POST 参数作为单个字符串,然后解析它们以查找字符串“ERROR”。

我知道有一个 $c->request->parameters 方法,但我不太确定它是如何使用的,而且我无法从 CPAN 文档中弄清楚它。

Specifically I'm trying to capture all the POST parameters from a payment gateway as a single string, and then parse them looking for the string 'ERROR'.

I'm aware that there's a $c->request->parameters method, but I'm not quite sure how its used and I couldn't figure it out from the CPAN documentation.

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

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

发布评论

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

评论(1

爱已欠费 2024-08-18 01:40:34

它返回带有必要数据的散列引用

my $hashref = $c->request->parameters;

形式为:

<input type="text" name="username" value="joe" />

将产生如下的散列引用:

my $hashref = {
    username => "joe", 
};

It returns a hash reference with the necessary data

my $hashref = $c->request->parameters;

A form with:

<input type="text" name="username" value="joe" />

Would result in a hashref like:

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