Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

fetch post js

var myHeaders = new Headers();

var myInit = { method: 'POST',
               headers: myHeaders,
               mode: 'cors',
               cache: 'default' };

fetch('flowers.jpg',myInit)
.then(function(response) {
  return response.blob();
})
.then(function(myBlob) {
  var objectURL = URL.createObjectURL(myBlob);
  myImage.src = objectURL;
});

Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #fetch #post #js
ADD COMMENT
Topic
Name
8+7 =