export const executeCode = (data) => {
return fetch("https://ide.geeksforgeeks.org/main.php",{
method: "POST",
headers: {
Accept : "application/json",
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
},
body: data
})
.then(response => response.json())
.catch(err => console.log(err))
}
I'm sending a POST request to G4G's compiler API. It's working fine in postman but not working in my react app.