Skip to content
SoftLee

Guide

Mocking a response with Map Local

Answer a request with a response you prepared, without contacting the server.

Map Local answers a request with a response you prepared. The real server is never contacted. Use it to build against an endpoint that doesn't exist yet, or to see how your app handles an error the server rarely returns.

  1. Map Local screen with the master switch and a list of rules
    Map Local screen with the master switch and a list of rules

    Step 01

    Open Map Local

    Open Map Local from the Tools tab and turn on the master switch. With it off, no rule runs.

  2. A Map Local rule: the domain, path and method to match, and the prepared status, headers and body
    A Map Local rule: the domain, path and method to match, and the prepared status, headers and body

    Step 02

    Choose what to match

    Add a rule and enter the domain, path and method to match. Use *.example.com for subdomains, and end a path with * to match anything after it, such as /v1/profile/*.

  3. A Map Local rule: the domain, path and method to match, and the prepared status, headers and body
    A Map Local rule: the domain, path and method to match, and the prepared status, headers and body

    Step 03

    Prepare the response

    Set the status code, headers and body SoftLee should send back. You can type the body or load it from a file, and the content type is set to match the file.

  4. A request's menu with Edit and Replay, Add to Compare, Add Breakpoint, Map Locally and Copy / Export
    A request's menu with Edit and Replay, Add to Compare, Add Breakpoint, Map Locally and Copy / Export

    Step 04

    Or start from a real response

    Open a captured call, tap the … menu and choose Map Locally. The rule starts with the real response, ready for you to change.

  5. Traffic list grouped by sequence, showing each request in the order it was made
    Traffic list grouped by sequence, showing each request in the order it was made

    Step 05

    Run your app

    Trigger the request in your app. SoftLee returns your prepared response immediately, and the request never leaves the device.