mocker-api icon indicating copy to clipboard operation
mocker-api copied to clipboard

Feature: Response patching

Open nathanredblur opened this issue 2 years ago • 0 comments

Response patching is a technique when a mocked response is based on the actual response. This technique may be useful when working with an existing API with an intention to augment it for various purposes (i.e., experimenting or debugging).

so, what I need is to let the proxy resolve the request, then modify the response data. Y try to do this using axios, but my API is in a https server and I get an error that I couldn't fix "unable to verify the first certificate" I tried with this approach https://backbencher.dev/articles/solved-unable-to-verify-first-certificate-axios-request and this https://technoteshelp.com/node-js-error-unable-to-verify-the-first-certificate-in-nodejs/

here you can see how what I want in other mocker https://mswjs.io/docs/recipes/response-patching

This feature is important because sometimes you are working in a feature where the data is dynamic and you want to work with that api data and plus your change, so patching is the best option to do it, but currently is impossible to do it even using axios.

  • [x] I have checked for other similar issues
  • [x] I have explained why this change is important
  • [x] I have added necessary documentation (if appropriate)

nathanredblur avatar Aug 29 '22 14:08 nathanredblur