简体   繁体   English

有没有一种方法可以模拟前端的后端响应?

[英]Is there a way to mock backend response for Front End?

I need these abilities. 我需要这些能力。

  • Track Requests being made and their responses. 跟踪正在发出的请求及其响应。
  • Put Request on modification filter which would either modify the request header/body and/or response's header/body for a certain url. 将“请求”放在修改过滤器上,该过滤器将修改某个URL的请求标头/正文和/或响应的标头/正文。
  • Be able to specify how closely to match request to apply modification (ie if url matches vs all headers matches vs body matches too). 能够指定匹配请求以应用修改的紧密程度(即url匹配vs所有标头匹配vs正文匹配)。
  • Replay requests. 重播请求。
  • Intercept and modify on live. 实时截取和修改。 Save Requests. 保存请求。

I wish postman could do it. 我希望邮递员可以做到。

I have not been able to find chrome extension that does this. 我还没有找到可以做到这一点的chrome扩展程序。 Most allow to modify header not body of request and none allow to mock response data. 大多数允许修改标头而不是请求主体,并且都不允许模拟响应数据。

I am open to terminal tools or stand alone tools. 我可以使用终端工具或独立工具。

Also assume i dont have control over backend at all or at the moment. 还要假设我根本无法控制后端,或目前无法控制后端。

This can be called stubbing api response as well. 这也可以称为桩API响应。

I think Charles Proxy is what you're looking for. 我认为Charles Proxy是您要找的东西。 It lets you perform response rewrites on the fly, in addition to a whole bunch of other really useful things. 除了一大堆其他真正有用的东西之外,它还可以让您即时执行响应重写

it's a paid application, but does have a free trial period. 这是一个付费应用程序,但是有免费试用期。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM