A POST reaches your handler from curl. The same JSON fails from a browser. Start by opening the browser Network panel: did it send an OPTIONS request, the POST itself, or neither?

Check the preflight first

A cross-origin POST with Content-Type: application/json or a custom signature header usually needs a preflight. The browser asks the receiver which origins, methods, and headers it permits. curl does not enforce the browser's CORS rules.

curl -i -X OPTIONS http://localhost:3000/api/webhook \
  -H 'Origin: https://apiflowstudio.onrender.com' \
  -H 'Access-Control-Request-Method: POST' \
  -H 'Access-Control-Request-Headers: content-type,stripe-signature'

Adapt the origin, port, and header to your test. A successful preflight should allow that origin, POST, and the requested headers. The POST response also needs an appropriate Access-Control-Allow-Origin header. Configure this only where direct browser testing is intended; ordinary provider-to-server webhooks do not require CORS.

Separate transport from signature validation

If OPTIONS fails, your handler may never receive the POST. If POST arrives but returns 400 or 401, inspect the receiver's test logs. A signature can fail because the secret is wrong, the timestamp is stale, or the handler verifies reserialized JSON instead of the original request bytes.

A browser CORS error does not prove that nothing reached the server. Check the receiver before retrying an operation that could have side effects. Never disable signature verification on a production handler to make a test pass.

Understand localhost

localhost in a browser points to the visitor's machine. localhost on a hosted backend points to that backend's machine. APIFlow dispatches localhost test webhooks directly from the browser; remote HTTP targets use its backend proxy. Browser local-network permissions, mixed-content restrictions, and CORS can still prevent delivery. It is not a universal tunnel replacement.

Try a controlled test

Use a dummy payload, a test-only signing secret, and a handler you control. In APIFlow, open Webhooks, select the matching provider, enter the test target and secret, and dispatch. Confirm the receiver validates the signature and inspect its response. APIFlow constructs synthetic events; it does not receive real provider events or reproduce their complete delivery behavior.

Reference: MDN's CORS guide.

Ready to try the workflow?

Open APIFlow