I use wp_remote_get to get data from another server. But WordPress "twenty twenty two" theme blocked my request. This is my code snippet.
$response = wp_remote_get($url_auth, array(
'blocking' => true,
'sslverify' => FALSE,
));
if (is_wp_error($response)) {
$error_message = $response->get_error_message();
echo "wp error: " . $error_message;
(new Debug)->log('rest.php:' . $error_message);
}
$body = wp_remote_retrieve_body($response);
$jsonobj = json_decode($body);
(new Debug)->log('response auth:' . $body);
on my debug log I got response like this
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex, nofollow">
<title>One moment, please...</title>
<style>
body {
background: #F6F7F8;
color: #303131;
font-family: sans-serif;
margin-top: 45vh;
text-align: center;
}
</style>
</head>
<body>
<h1>Please wait while your request is being verified...</h1>
<form id="wsidchk-form" style="display:none;" action="/z0f76a1d14fd21a8fb5fd0d03e0fdc3d3cedae52f" method="get">
<input type="hidden" id="wsidchk" name="wsidchk"/>
</form>
<script>.....and so on
it seems like the theme redirected my request to another page. How to deal with it?