Answers for "fetch post php"

PHP
1

fetch body show in php code

$entityBody = file_get_contents('php://input');
Posted by: Guest on June-27-2020
0

fetch body show in php code

$entityBody = stream_get_contents(STDIN);
Posted by: Guest on June-27-2020
0

fetch method post handing the post add on php

// if you are going to use post method you need to send the data/body  using the formdata object
var url = '/your/url';
var formData = new FormData();
formData.append('x', 'hello');

fetch(url, { method: 'POST', body: formData })
.then(function (response) {
  return response.text();
})
.then(function (body) {
  console.log(body);
});
Posted by: Guest on October-28-2021

Browse Popular Code Answers by Language