TeslaReplay v0.1.2 Tesla.Middleware.Replay View Source

Simple middleware for saving/replaying response data.

This middleware intercepts requests and either returns locally stored data or performs the request and saves the result to disk (to replay for future requests).

Example usage

defmodule MyClient do
  use Tesla

  plug Tesla.Middleware.Replay, path: "priv/fixtures/"
end

Options

  • :path - Path to fixture files (defaults to fixtures/)
  • :statuses - List of HTTP statuses to cache or :all to intercept all requests (defaults to 200)

Link to this section Summary

Link to this section Types

Link to this type opt() View Source
opt() :: {:statuses, integer() | :all} | {:path, binary()}