Код: Выделить всё
// Prepares the payload with site and plugin information.
$payload = [
'purchase_code' => $code,
'domain' => wp_parse_url( home_url(), PHP_URL_HOST ),
'site_url' => home_url( '/' ),
'install_id' => self::get_install_id(),
'plugin' => 'tmdb-scb',
'version' => defined( 'TMDB_SCB_VERSION' ) ? TMDB_SCB_VERSION : '1.0.0',
];
// Configures the arguments for the remote request.
$args = [
'headers' => [
'Content-Type' => 'application/json',
],
'timeout' => 10,
'sslverify' => true,
'body' => wp_json_encode( $payload ),
];
< /code>
Когда я проверяю журнал отладки, я получаю следующий вывод. < /p>
(
[headers] => WpOrg\Requests\Utility\CaseInsensitiveDictionary Object
(
[data:protected] => Array
(
[server] => openresty/1.27.1.1
[date] => Sun, 14 Sep 2025 11:41:43 GMT
[content-type] => text/html
[content-length] => 185
)
)
[body] =>
415 Unsupported Media Type
415 Unsupported Media Type
openresty/1.27.1.1
[response] => Array
(
[code] => 415
[message] => Unsupported Media Type
)
[cookies] => Array
(
)
[filename] =>
[http_response] => WP_HTTP_Requests_Response Object
(
[data] =>
[headers] =>
[status] =>
[response:protected] => WpOrg\Requests\Response Object
(
[body] =>
415 Unsupported Media Type
415 Unsupported Media Type
openresty/1.27.1.1
[raw] => HTTP/1.1 415 Unsupported Media Type
Server: openresty/1.27.1.1
Date: Sun, 14 Sep 2025 11:41:43 GMT
Content-Type: text/html
Content-Length: 185
Connection: close
415 Unsupported Media Type
415 Unsupported Media Type
openresty/1.27.1.1
[headers] => WpOrg\Requests\Response\Headers Object
(
[data:protected] => Array
(
[server] => Array
(
[0] => openresty/1.27.1.1
)
[date] => Array
(
[0] => Sun, 14 Sep 2025 11:41:43 GMT
)
[content-type] => Array
(
[0] => text/html
)
[content-length] => Array
(
[0] => 185
)
)
)
[status_code] => 415
[protocol_version] => 1.1
[success] =>
[redirects] => 0
[url] => https://www.metinmete.com.tr/license-check/
[history] => Array
(
)
[cookies] => WpOrg\Requests\Cookie\Jar Object
(
[cookies:protected] => Array
(
)
)
)
[filename:protected] =>
)
)
[14-Sep-2025 11:45:59 UTC] Array
(
[headers] => WpOrg\Requests\Utility\CaseInsensitiveDictionary Object
(
[data:protected] => Array
(
[server] => openresty/1.27.1.1
[date] => Sun, 14 Sep 2025 11:45:58 GMT
[content-type] => text/html
[content-length] => 185
)
)
[body] =>
415 Unsupported Media Type
415 Unsupported Media Type
openresty/1.27.1.1
[response] => Array
(
[code] => 415
[message] => Unsupported Media Type
)
[cookies] => Array
(
)
[filename] =>
[http_response] => WP_HTTP_Requests_Response Object
(
[data] =>
[headers] =>
[status] =>
[response:protected] => WpOrg\Requests\Response Object
(
[body] =>
415 Unsupported Media Type
415 Unsupported Media Type
openresty/1.27.1.1
[raw] => HTTP/1.1 415 Unsupported Media Type
Server: openresty/1.27.1.1
Date: Sun, 14 Sep 2025 11:45:58 GMT
Content-Type: text/html
Content-Length: 185
Connection: close
415 Unsupported Media Type
415 Unsupported Media Type
openresty/1.27.1.1
[headers] => WpOrg\Requests\Response\Headers Object
(
[data:protected] => Array
(
[server] => Array
(
[0] => openresty/1.27.1.1
)
[date] => Array
(
[0] => Sun, 14 Sep 2025 11:45:58 GMT
)
[content-type] => Array
(
[0] => text/html
)
[content-length] => Array
(
[0] => 185
)
)
)
[status_code] => 415
[protocol_version] => 1.1
[success] =>
[redirects] => 0
[url] => https://www.metinmete.com.tr/license-check/
[history] => Array
(
)
[cookies] => WpOrg\Requests\Cookie\Jar Object
(
[cookies:protected] => Array
(
)
)
)
[filename:protected] =>
)
)
Подробнее здесь: https://stackoverflow.com/questions/797 ... type-error