Request Mocking Protocol (RMP) is a specification for HTTP requests mocking in end-to-end tests. It uses declarative JSON schemas to define mocked request and response. These schemas can be serialized and sent over the network, enabling both client-side and server-side mocking.
RMP lets you mock API calls made by your application server. Here's how it works:
- A test defines mock schemas and sends them to the app server in a custom HTTP header:
x-mock-request. - The server-side interceptor reads that header and applies the mocks to the outgoing API calls.
- The page is rendered with mocked data, and the test can assert the expected UI state.
This is ideal for server-side rendered pages, where data is fetched on the server before the page reaches the browser. Learn how to set it up in Server-Side Mocking →
RMP also lets you mock requests made directly in the browser, using the same declarative schemas. It works with any framework, no special integration needed.
This is ideal for single-page apps and any data fetched on the client. Learn how to set it up in Client-Side Mocking →
Full documentation is available at vitalets.github.io/request-mocking-protocol.

