Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

fetch and edit jsonplaceholder api

fetch('https://jsonplaceholder.typicode.com/posts/1', {
  method: 'PUT',
  body: JSON.stringify({
    id: 1,
    title: 'foo',
    body: 'bar',
    userId: 1,
  }),
  headers: {
    'Content-type': 'application/json; charset=UTF-8',
  },
})
  .then((response) => response.json())
  .then((json) => console.log(json));
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to render a new page in node js through express 
Javascript :: copy to clipboard javascript dom 
Javascript :: js navigate to anchor 
Javascript :: js get current timezone offset 
Javascript :: how to use bootstrap icons in react components 
Javascript :: javascript squared 
Javascript :: alphabet as array javascript 
Javascript :: remove duplicates from array js 
Javascript :: check if element has specific child javascript 
Javascript :: js populate an empty array of zeros 
Javascript :: getitem localstorage 
Javascript :: puppeteer get attribute 
Javascript :: for each jquery 
Javascript :: factorial javascript 
Javascript :: safeareaview not working on android react native 
Javascript :: Prevent Double Submit with JavaScript 
Javascript :: check if a column is unique sql 
Javascript :: addclass to elementref angular 
Javascript :: function js format money 
Javascript :: json foreach in javascript 
Javascript :: check if any property of object is null javascript 
Javascript :: nl2br javascript 
Javascript :: javascript remove class with transition 
Javascript :: using map in useeffect 
Javascript :: javascrip check if string contains substring 
Javascript :: localstorage set item 
Javascript :: promise in forloop 
Javascript :: create file if not exists nodejs 
Javascript :: on change field text jquery 
Javascript :: outer width jquery 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =