Get values through post method from URL
Looking at your screen shot, you have not passed body key values, instead you passed params.
Click on Body Tab and then pass key & value pair.
As per your screenshot you are sending your empid
through query parameter so you need to access that as follows
<?php
if (isset($_GET['empid'])) {
echo $_GET['empid'];
}else{
// else part
}
also for that you need to Request Url in Postman using GET
method.
But as you have stated that you want to send empid
through POST
in postman, you have to send it through form-data
in Postman and access it as $_POST["empid"];
. following is the screenshot for your reference
else there is another option where you can send the POST
data through body
as row json
and access it as
$rawPostData = file_get_contents('php://input');
$jsonData = json_decode($rawPostData);
and $post
will contain the raw data
. And you can send it through postman as in following screenshot.