- Disable unnecessary policies, especially those meant for XML/JSON data.
- If using the validate-content policy to ensure your backend produces the correct content type, make sure its configuration doesn't corrupt HTML.
- Experiment by temporarily disabling security features, caching, or other gateway-level transformations. This helps isolate the root cause.
- Adjust settings specifically designed for HTML if available.
- Use a tool like Postman or curl to test your backend directly. Compare the HTML output to what you receive through APIM. This helps determine if the backend is the issue.
Azure API Management does not return formatted HTML content
I am using API Management in Azure and I have backend that returns only HTML response. When I try to access the website directly I am able to view a well formatted HTML page, but after onboarding the backend to API GW when I try to access the website through the API GW I see that lot of formatting is missing. Is there anything that I can do in the policies to receive a well formed HTML without any missing tags? Also, is API GW the right fit here? Do I have to explore using any other service?