Proxy & Recording
Proxy & Recording
Section titled “Proxy & Recording”API Dev Studio can proxy requests to real APIs and record the responses. This lets you:
- Capture real API behavior automatically
- Generate mocks from recorded responses
- Switch between live and mock modes
Creating a Proxy Endpoint
Section titled “Creating a Proxy Endpoint”- Click New Endpoint and select Proxy
- Configure:
- Path: The path to proxy (e.g.,
/api/users) - Target URL: The real API URL (e.g.,
https://api.example.com/users)
- Path: The path to proxy (e.g.,
- Save the endpoint
How Proxying Works
Section titled “How Proxying Works”When a request hits your proxy endpoint:
- API Dev Studio forwards the request to the target URL
- The real API responds
- API Dev Studio returns that response to the caller
- The request/response is logged (and optionally recorded)
Recording Mode
Section titled “Recording Mode”Enable recording to capture responses for mock generation:
- Open your proxy endpoint
- Toggle Recording on
- Make requests through the proxy
- Responses are saved to the Recordings tab
Viewing Recordings
Section titled “Viewing Recordings”- Select your proxy endpoint
- Click the Recordings tab
- See all captured responses with timestamps
Each recording shows:
- Request method and path
- Response status code
- Response body
- Timestamp
Generate Mocks from Recordings
Section titled “Generate Mocks from Recordings”Convert recordings into mock endpoints:
- In the Recordings tab, select one or more recordings
- Click Generate Mock
- Choose how to handle duplicates:
- Merge: Combine as response variations
- Update: Replace existing mock
- Skip: Keep existing, ignore new
The generated mock uses the recorded response as its body. Endpoints are reloaded automatically after generation, so the new mock is available immediately without restarting the server.
Live vs Mock Mode
Section titled “Live vs Mock Mode”Toggle between live (proxy) and mock modes:
- Live Mode: Requests go to the real API
- Mock Mode: Requests return your mock responses
This lets you develop against real data, then switch to mocks for offline work or testing edge cases.
Best Practices
Section titled “Best Practices”- Start with proxy: Begin by proxying the real API
- Record key scenarios: Capture success, error, and edge cases
- Generate mocks: Convert recordings to mocks
- Enhance mocks: Add template variables for dynamic data
- Switch to mock mode: Develop offline with realistic data