rest_request()

WordPressの関数:rest_request()

関数の概要

rest_request()関数は、WordPress REST APIを使用して外部サーバーにリクエストを送信するための関数です。

パラメータの説明

  • $url: リクエストを送信するURL。
  • $args: リクエストに関する追加のパラメータ。

戻り値

外部サーバーからのレスポンスを返します。

使用例

 $response = rest_request('https://example.com/api/data', array('method' => 'GET'));
echo $response;

関連する関数

  • wp_remote_get(): 外部サーバーからデータを取得するための関数。
  • wp_remote_post(): 外部サーバーにデータを送信するための関数。