STANAANDREY

fetch-post ex

Aug 25th, 2021 (edited)
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const object = {
  2.     id: 3,
  3.     content: "the content!!!",
  4.     nef: 23//useless data
  5. }
  6.  
  7. const options = {
  8.     method: 'POST',
  9.     headers: {
  10.         'Content-type':'application/json'
  11.     },
  12.     body: JSON.stringify(object)
  13. };
  14.  
  15. fetch('http://localhost:8080/postGreet', options);
Add Comment
Please, Sign In to add comment