Stoobly Docs
  • Introduction
  • Use Cases
    • Generate Mock APIs
      • Empower Development
      • Scale API Testing
    • Enable E2E Testing
  • FAQ
    • Recording
    • Mocking
    • Terminology
  • Getting Started
    • Installing the Agent
      • Installation with pipx
      • Installation with Docker
  • Core Concepts
    • Agent
      • Intercept Modes
        • Mocking
        • Recording
      • Lifecycle Hooks
      • Proxy Settings
        • Data Rules
        • Firewall Rules
        • Rewrite Rules
        • Match Rules
    • Context
    • Mock API
      • Request
        • Response
        • Replay History
      • Scenarios
      • Snapshots
      • Fixtures
      • Public Folder
    • Scaffold
      • Service
      • Validation
      • Workflow
  • Guides
    • How to Run the Agent
      • Run with CLI
      • Run with Docker
    • How to Configure the Agent
      • Forward Proxy
        • Enable HTTPS Traffic
      • Reverse Proxy
    • How to Record Requests
      • Recording from the UI
      • Recording from the CLI
      • How to Create Contexts
      • How to Create Scenarios
        • Creating from the UI
        • Creating from the CLI
      • How to Create Requests
      • How to Customize Recordings
        • Customizing with Lifecycle Hooks
    • How to Update Requests
      • Editing from the UI
      • Editing with Snapshots
      • How to Update Scenarios
        • Updating from the UI
        • Updating from the CLI
      • Updating with Replay
        • Replaying from the UI
        • Replaying from the CLI
        • How to Customize Replays
          • Customizing with Lifecycle Hooks
      • Updating with Open API
    • How to Mock APIs
      • How to Enable Mocking
        • Enabling from the UI
        • Enabling from the CLI
      • How to Snapshot Requests
        • Deleting Snapshots
        • Sharing Snapshots
      • How to Use Fixtures
      • How to Customize Mocking
        • Customizing with Lifecycle Hooks
        • Customizing with Request Headers
      • Troubleshooting
    • How to Replay Requests
      • Replay with the UI
      • Replay with the CLI
    • How to Integrate E2E Testing
      • How to Scaffold an App
        • Scaffolding a Service
        • Customizing a Workflow
          • Customizing Container Services
          • Customizing Lifecycle Hooks
          • Customizing Init Scripts
          • Customizing Configure Scripts
          • Customizing Makefile
        • Troubleshooting
      • How to Run a Workflow
        • Running with CLI command
        • Running with Make
        • Troubleshooting
          • Validating
      • How to Stop a Workflow
        • Stopping with CLI command
        • Stopping with Make
      • How to Update a Scaffold
        • Deleting a Service
      • FAQ
  • Developer Guide
    • Installation from Source
    • Submitting Change Requests
    • Releases
  • Experimental
    • Experimental Features
      • Aliases
      • Endpoints
      • API Testing
        • Getting Started
        • Configuration
          • Assign
          • Lifecycle Hooks
          • Trace
      • Optional Components
Powered by GitBook
On this page
  • Replaying a Request
  • Command
  • Options
  • Replay but Do Not Save
  • Replay and Create a New Request
  • Replay and Save to Replay History
  • Replay and Immediately Overwrite

Was this helpful?

  1. Guides
  2. How to Replay Requests

Replay with the CLI

Replaying a Request

Command

stoobly-agent request replay <REQUEST-KEY>

Options

$ stoobly-agent request replay --help
Usage: stoobly-agent request replay [OPTIONS] REQUEST_KEY

  Replay a request

Options:
  --format [body|json]            Format replay response.
  --host TEXT                     Rewrite request host.
  --lifecycle-hooks-script-path TEXT
                                  Path to lifecycle hooks script.
  --log-level [debug|info|warning|error]
                                  Log levels can be "debug", "info",
                                  "warning", or "error"

  --overwrite                     Replay request and overwrite existing
                                  response.

  --record                        Replay request and record.
  --save                          Replay request and save to history.
  --scenario-key TEXT             Record to scenario.
  --scheme [http|https]           Rewrite request scheme.
  -h, --help                      Show this message and exit.

Replay but Do Not Save

To replay a request and NOT save it anywhere, run the command with no flags:

$ stoobly-agent request replay REQUEST_KEY

This can be useful for replaying the request before doing any mutating operations to confirm the API changes are expected.

Replay and Create a New Request

The --record flag will replay the original request, but create an entirely new request:

$ stoobly-agent request replay --record REQUEST_KEY

This can be useful if you want to save the request to Stoobly and inspect it as a separate request in the UI. Please be aware that this will not allow you to update the original request with the new one since it is considered a different request altogether.

Replay and Save to Replay History

$ stoobly-agent request replay --save REQUEST_KEY

This links the rerecording with the original request but won't change the response yet. This enables you to manually overwrite and update the response later.

Replay and Immediately Overwrite

To update a request immediately, use the --overwrite flag which will do the same as the --save flag AND also set the request's response to that latest replayed instance:

$ stoobly-agent request replay --overwrite REQUEST_KEY

This command option is the most convenient one because it replays, rerecords, and overwrites the response all in one go.

PreviousReplay with the UINextHow to Integrate E2E Testing

Last updated 1 year ago

Was this helpful?

The --save flag will replay the request and save it to the for that request:

Replay History