top of page

Forum Posts

Andrew Langemann
Jun 04, 2023
In Coding with Velo
Hello, I have a site that utilizes the wix-fetch module to make HTTP POST calls. Up until a few days ago, I was able to perform POSTs like so and everything worked: import { fetch } from 'wix-fetch'; fetch("https://some-url", { method: "POST", body: JSON.stringify({ data: "some data" }), }); However, then a few days ago my site stopped working. I discovered that the fetch call was no longer sending the request body. I was very confused by this and could find no documentation explaining that anything changed. After trial and error, I discovered that I had to add the "Content-Type" header to make it work as before: import { fetch } from 'wix-fetch'; fetch("https://some-url", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ data: "some data" }), }); Was this an intentional change? Is there any way I can be informed in the future of changes like this so my site doesn't just break next time? I have customers whose product sales were likely impacted because of the outage this caused. Thanks, Andrew
0
0
7

Andrew Langemann

More actions
bottom of page