Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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);
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #fetch #method #post #handing #post #add #php
ADD COMMENT
Topic
Name
5+5 =