Skip to content

Instantly share code, notes, and snippets.

@joshuaaguilar20
Last active July 19, 2021 20:28
Show Gist options
  • Save joshuaaguilar20/49fab146c440b42c59f5ce1662f9cd21 to your computer and use it in GitHub Desktop.
Save joshuaaguilar20/49fab146c440b42c59f5ce1662f9cd21 to your computer and use it in GitHub Desktop.
Promises

Promises

  • item one
  • item teo

Get

  • fetching info
 fetch(newURL)
      .then(response => response.json())
      .then(json => {
        return json 
      }).catch(e => console.log("Invalid Pokemon"))
}

Delete

Post

  • create new post
  • what does this post contain
 {
    id: 1,
    title: 'foo',
    body: 'bar',
    userId: 1,
  }
  • when to use post over get request for sending information.
 node index.js posts --filelocation of posts to upload
 node index.js posts 

Put

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment