Chrome Console Send Post Request Code Example


Example 1: how to send a post by console chrome

fetch('https://www.hackthebox.eu/api/invite/generate', {   method: 'POST',   body: JSON.stringify({     title: 'foo',     body: 'bar',     userId: 1   }),   headers: {     'Content-type': 'application/json; charset=UTF-8'   } }) .then(res => res.json()) .then(console.log)

Example 2: chrome developer tools send get request

fetch('https://jsonplaceholder.typicode.com/posts/1')   .then(res => res.json())   .then(console.log)

Example 3: chrome developer tools send get request

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

Comments

Popular posts from this blog

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?