Skip to content

Instantly share code, notes, and snippets.

@yordis
Created May 15, 2023 20:29
Show Gist options
  • Save yordis/ea7226110cc578e4372845e3dffd92d3 to your computer and use it in GitHub Desktop.
Save yordis/ea7226110cc578e4372845e3dffd92d3 to your computer and use it in GitHub Desktop.
Livebooks
Mix.install([
  {:tesla, github: "elixir-tesla/tesla", branch: "master"},
  {:mint, "1.5.1"},
  {:castore, "1.0.2"}
])

Testing Mint

defmodule TeslaMintClientActiveMode do
  use Tesla
  adapter(Tesla.Adapter.Mint)

  def get_example_http2_site() do
    get("https://remoteok.io", mode: :active)
  end
end
TeslaMintClientActiveMode.get_example_http2_site()
defmodule TeslaMintClientPassiveMode do
  use Tesla
  adapter(Tesla.Adapter.Mint)

  def get_example_http2_site() do
    get("https://remoteok.io", mode: :passive)
  end
end
TeslaMintClientPassiveMode.get_example_http2_site()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment