fetch()
PHP で POST データを取得するために、API POST メソッドを使用しようとしています。
これが私が試したことです:
var x = "hello";
fetch(url,{method:'post',body:x}).then(function(response){
return response.json();
});
PHP:
<?php
if(isset($_GET['x']))
{
$get = $_GET['x'];
echo $get;
}
?>
これは正しいです?