title: Fetch and POST tags: js fetch post # Example ```js fetch("be.php", { headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, method: "POST", body: JSON.stringify({req:"put",url}) } ) .then(response => { if( response.ok ) { console.log("ok") window.location.reload() } return response.text() }).then(text=> { console.log(text) }) ```