I’m using a Shopify app proxy to call a POST API from the storefront to my server. However, I’m facing an issue where the data in my request body sometimes gets altered. When I pass a number, it occasionally gets changed to [email removed]@bi58k’, or sometimes the entire body becomes undefined. I’ve checked the request body at the storefront before making the API call, and everything appears correct. Please help me.
Hi @123344 ,
Sometimes these issues can be due to how the data is being encoded or transformed by Shopify’s proxy system. One thing I’d check is whether your content type is set correctly – make sure you’re sending your data as application/json if you’re using JSON, and that you’re using JSON.stringify on your body before the call.
It’s also possible that the proxy is doing some sort of transformation on the payload if it isn’t properly formatted. Double-check your headers and try logging the raw payload on your server before any processing happens.
Sometimes even minor discrepancies in encoding can cause strange output like the [email removed]@bi58k’ you mentioned. If everything looks right on the storefront side, then the issue might be happening in transit. You might consider setting up a temporary endpoint to log the exact incoming request from the proxy, which could help you pinpoint where the alteration is happening.