Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

KinoCurl

livebooks/kino/kino_curl.livemd

KinoCurl

Mix.install([
  {:kino_curl, "~> 0.1.0"}
])

GET

response = ExCurl.get!("https://httpbin.org/get?lang=elixir")

POST

response =
  ExCurl.post!("https://httpbin.org/post",
    body: "{\"lang\": \"elixir\"}",
    headers: %{"Content-Type" => "application/json"}
  )

PUT

response =
  ExCurl.put!("https://httpbin.org/put",
    body: "{\"lang\": \"elixir\"}",
    headers: %{"Content-Type" => "application/json"}
  )

PATCH

response =
  ExCurl.patch!("https://httpbin.org/patch",
    body: "lang=elixir",
    headers: %{"Content-Type" => "application/x-www-form-urlencoded"}
  )

DELETE

response = ExCurl.delete!("https://httpbin.org/delete")