.htaccess文件在php中没有获取post方法

.htaccess文件在php中没有获取post方法,php,.htaccess,rest,Php,.htaccess,Rest,我正在使用这个简单的.htaccess文件实现rest服务 Options +FollowSymlinks RewriteEngine on RewriteRule ^([a-zA-Z_-]*)$ get_price.php?name=$1 [nc,qsa] 目前,它使用$\u GET方法并返回 { status: 200 status_message: "Record found" data: "kashif@gmail.com" } 但我使用它返回的$\u POST传递参数 { sta

我正在使用这个简单的.htaccess文件实现rest服务

Options +FollowSymlinks
RewriteEngine on

RewriteRule ^([a-zA-Z_-]*)$ get_price.php?name=$1 [nc,qsa]
目前,它使用$\u GET方法并返回

{
status: 200
status_message: "Record found"
data: "kashif@gmail.com"
}
但我使用它返回的$\u POST传递参数

{
status: 200
status_message: "Record found"
data: ""
}
知道我哪里做错了吗。我不是.htaccess文件的专家

下面是我的简单测试类get_price.php

<?php

header("Content-Type:application/json");
include 'header.php';
$name = $_REQUEST['name'];

 $friendResult = mysqli_query($con,"SELECT id FROM user
                    WHERE name='$name'");

    $row = mysqli_fetch_array($friendResult);

          $data = $row['id'];

deliver_response(200,"Record found",$data);

function deliver_response($status,$status_message,$data){

header("HTTP/1.1 $status $status_message");
$response['status'] = $status;
$response['status_message'] = $status_message;
$response['data'] = $data;

$json_response = json_encode($response);

echo $json_response ;

}


?>

?key=value
仅为
$\u GET
参数。@就我所知,如何为post alsoAs生成它们。htaccess仅处理GET参数(?)。也许您需要向我们展示
get\u price.php
中的内容。这里缺少很多细节。什么URL被发送到服务器,什么是
get_price.php
工作?@anubhava我已经编辑了我的类。这是一个简单的测试类,我需要为PHP post请求实现restful服务。。。。