我应该如何使用返回响应策略处理大型模拟响应 [英] How should I handle large mock responses with the return-response policy
问题描述
我正在尝试使用返回响应策略来模拟动态响应,该策略返回 根据查询参数设置的特定响应。当我设置此响应的主体时,我目前使用多个Named值来存储响应
的详细信息。但是这限制为4096个字符,我需要能够添加更大规模的响应。
I am trying to mock a dynamic response using the return-response policy which returns a specific response depending on the query parameters set. When I set the body of this response I currently make use of multiple Named values to store the response details. This however is limited to 4096 characters and I need to be able to add responses of a much larger scale.
有没有更好的方法来处理模拟大响应?
Is there a better way to handle mocking large responses?
推荐答案
通常,模拟响应的推荐方法是使用
模拟回复
政策
但我认为要求的动态性质无法实现。
Normally, the recommended way for mocking responses would be to use the
mock-response
policy but I guess the dynamic nature of requirement can't be implemented with just that.
此外, 命名值 是
,主要用于处理机密和分类。
Also, Named Values are mostly meant for working with secrets and the sorts.
我能想到2个替代品
- 将模拟卸载到功能应用程序
- 将模拟响应存储在blob存储中并使用 相应地获取它们;
发送请求
政策
这篇关于我应该如何使用返回响应策略处理大型模拟响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!