Forwarding & Recording AI-generated

A reaction's Forward to Live Service section (see Reactions) sends the matched request through to a real backend instead of returning a static payload - and, with caching turned on, that same mechanism is how MockMotor records real traffic into brand-new mock reactions automatically. There's no separate "forward when nothing else matches" mode - it's a plain reaction with Forward configured, so you get that fallback behavior for free by simply putting a broadly-matching forward reaction last in the list.

Why forward instead of mock

  • Mock only the handful of operations you actually need to control, and let everything else fall through to the real backend.
  • Add a reaction for an endpoint the real backend doesn't support yet (a planned but unimplemented feature).
  • Capture and preserve a real service's responses before it goes away (e.g. a shared test environment's lease expiring).

Forward settings

  • Forward URL - the real backend's full URL.
  • Append Relative URI / Append Query Parameters - Append carries the incoming request's path remainder/query string onto the forward URL automatically; Skip lets you script a fully custom target instead.
  • Read Timeout - how long to wait for the backend before giving up.
  • Payload for Forward - by default the original request body, relative URL, query string and HTTP headers are all forwarded as-is; this field lets you modify the payload in flight (e.g. injecting a value, rewriting an ID) before it reaches the real backend.
  • Cache Transactions - when on, each forwarded exchange is saved as a new, temporary "cached" reaction that mimics what the real backend just returned.

If the real backend requires authentication, call the mock with the same credentials you'd use against the real thing (e.g. the same Authorization header) - MockMotor forwards them through as-is, so the backend authenticates the call normally. Two-way SSL (client-certificate) authentication to the backend is not supported.

Recording as a workflow

Point a reaction at the real service with Cache Transactions enabled, send it representative traffic, then look at the resulting cached reactions - shown under the service's Recorded tab, and marked "To be Lost" in the reactions list since they disappear the next time the cache is cleared. Download or clone the ones worth keeping into permanent reactions before that happens. Only turn recording on when you actually want to capture traffic - it's not meant to be left on permanently.

Importing captured traffic

Traffic captured outside MockMotor - a Fiddler session, or a raw request/response pair - can also be imported directly into a new reaction, without needing a live Forward round-trip at all. Useful when you already have a real capture on hand (from a browser proxy, or a colleague) rather than a reachable live backend to record from.