What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-02-28 16:45:07
faker link for json post req
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((response) => r... Add solution -
Javascript 2022-02-24 19:55:02
how to send json in js with post
// Sending and receiving data in JSON format using POST method // var xhr = new XMLHttpRequest(); var url = "url"; xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/json"); xhr.onreadyst... Add solution -
-
Javascript 2022-02-20 06:25:16
javascript window.onpopstate example
window.onpopstate = function(event) { alert("location: " + document.location + ", state: " + JSON.stringify(event.state)); const urlParams = new URLSearchParams(window.location.search); const myParam = urlParams.get('myParam'); ... Add solution