向现有POST请求添加版本控制不向后兼容 [英] Adding versioning to an existing POST request is not backward compatible
问题描述
您好,Azure API管理团队,
如果您已有一个带有POST端点的API,请按标头添加版本控制(在我的情况下为接受"),那么原始POST端点现在仅以404状态响应.
预期:
没有标题的POST到/address-search会击中V1后端
POST到/address-search(带有空白的Accept标头)会打到V1后端
使用Accept标头'v2'到/address-search的发布会触及V2后端
实际:
没有标题的POST到/address-search会收到404
POST到/address-search(带有空白的Accept标头)会打到V1后端
使用Accept标头'v2'到/address-search的发布会触及V2后端
删除V2后,原始文件将再次开始响应.
谢谢
Greg Myers
Hello Azure API Management team,
If you have an existing API with a POST endpoint, adding versioning by header (In my case Accept) then the original POST endpoint now only responds with a 404 status.
Expected:
POST to /address-search with no header hits the V1 backend
POST to /address-search with a blank Accept header hits the V1 backend
POST to /address-search with an Accept header 'v2' hits the V2 backend
Actual:
POST to /address-search with no header receives 404
POST to /address-search with a blank Accept header hits the V1 backend
POST to /address-search with an Accept header 'v2' hits the V2 backend
Once you delete V2, the original starts to respond again.
Thanks,
Greg Myers
推荐答案
您可以使用API Inspector进行跟踪调用.请参阅此链接: https://docs.microsoft.com/zh-CN/azure/api-management/api-management-howto-api-inspector 其中 描述了如何使用API Inspector来跟踪API管理中的调用.
You can get trace call by using API Inspector. Refer this link: https://docs.microsoft.com/en-us/azure/api-management/api-management-howto-api-inspector which describes, how to use API Inspector to trace call in API Management.
另外,请尝试配置 错误处理策略,用于API管理中的错误处理,看看是否有帮助.
Also, try to configure on-error policy for error handling in API Management and see if it helps.
Have you configure "set-backend-service" policy?
这篇关于向现有POST请求添加版本控制不向后兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!