Answer the question
In order to leave comments, you need to log in
Is it possible to receive callback on WP via php://input?
Hello, is it possible on the WP front to receive a callback from the api of another site via php://input ?
If so, how?
I tried to make a callback indicator by adding information to the file and everything worked correctly,
but when I wrote
$str = json_decode(file_get_contents('php://input'));
That file was empty
Answer the question
In order to leave comments, you need to log in
add an endpoint, for example domain.com/callback
like this:
$requestUri = !empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
$requestUri = trailingslashit($requestUri);
if ($requestUri === '/callback/') {
// Обработка php://input
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question