how to code teh post in php

I need the php code for the post request below:

app.post('/getSession', function (req, res) {

        // We need a URL from the client to call
        if (!req.body.url) return res.sendStatus(400);

        const options = {
                url: req.body.url,
                cert: Cert,
                key: Cert,
                method: 'post',
                body: {
                        merchantIdentifier: MERCH_ID,
                        domainName: DOMAIN,
                        displayName: 'estore',
                },
                json: true,
        }

        // Send the request to the server and return the response to the client
        request(options, function(err, response, body) {
                if (err) {
                        console.log('Error generating session!');
                        console.log(err, response, body);
                        res.status(500).send(body);
                }
                res.send(body);
        });
});

Open in new window

Newton21205Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chris StanyonWebDevCommented:
Not clear what you actually need. If you want to read the post response in PHP, then you examine the $_POST variable

<?php
var_dump($_POST);

Open in new window

0
Newton21205Author Commented:
I have pasted the js code need php code for the same.
0
leakim971PluritechnicianCommented:
$merchantIdentifier = $_POST["merchantIdentifier"];
$domainName = $_POST["domainName"];
$displayName = $_POST["displayName"];

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.