首页 > 解决方案 > 使用 POST 对 PHP 的邮递员请求

问题描述

这是我的代码:

<?php
    if(isset($_POST["test"]))
        echo $_POST["test"];
    if(isset($_GET["test"]))
        echo $_GET["test"];
?>

我的问题是:为什么 POST 请求不起作用?

我在正文和标题中尝试了不同的参数,但没有任何效果。

Postman 中的 GET 请求工作: GET 请求邮递员

Postman 中的 POST 请求失败: POST 请求邮递员

标签: phppostrequestpostman

解决方案


<?php 
  $name = $_POST['name'];
  echo $name;
?>

推荐阅读