Tesla.Mock.json

You're seeing just the function json, go back to Tesla.Mock module for more information.

Specs

json(body :: term(), opts :: response_opts()) :: Tesla.Env.t()

Return JSON response.

Example

import Tesla.Mock

mock fn
  %{url: "/ok"} -> json(%{"some" => "data"})
  %{url: "/404"} -> json(%{"some" => "data"}, status: 404)
end