使用Postman发送POST参数无效,但是发送GET参数有效

编程入门 行业动态 更新时间:2024-10-28 12:23:15
本文介绍了使用Postman发送POST参数无效,但是发送GET参数有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试使用Chrome扩展程序Postman测试一个简单的PHP页面.当我发送URL参数时,脚本可以正常工作(例如,变量在$_REQUEST参数中可用).当我将它们作为x-www-form-urlencoded参数发送时,$_REQUEST参数仅包含PHPSESSID.

脚本:

<?php var_export($_REQUEST); ?>

当我发送URL参数时,$_REQUEST包括它们:

但是当我将它们作为 POST 变量发送时,$_REQUEST不包括它们:

我想念什么?

解决方案

我将Postman中的url设置为,但是Apache重定向到了,并且以某种方式删除了POST变量. /p>

将其更改为后,POST变量可以正常工作.

另请参阅: stackoverflow/a/28461500/704803

I'm trying to test a simple PHP page using the Chrome extension Postman. When I send URL parameters, the script works fine (eg the variables are available in the $_REQUEST parameter). When I send them as x-www-form-urlencoded parameters, the $_REQUEST parameter only contains the PHPSESSID.

The script:

<?php var_export($_REQUEST); ?>

When I send URL parameters, $_REQUEST includes them:

But when I send them as POST variables, $_REQUEST doesn't include them:

What am I missing?

解决方案

I was setting the url in Postman to be but Apache was redirecting to and somehow the POST variables were being dropped along the way.

After I changed it to , the POST variables worked properly.

See also: stackoverflow/a/28461500/704803

更多推荐

使用Postman发送POST参数无效,但是发送GET参数有效

本文发布于:2023-10-10 11:21:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1478522.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:参数   Postman   POST

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!