No description
  • Gleam 98.9%
  • Elixir 1.1%
Find a file
2025-05-16 22:49:07 +03:00
src Fix request options and make work on latest Gleam 2025-05-16 22:48:20 +03:00
test Fix request options and make work on latest Gleam 2025-05-16 22:48:20 +03:00
.gitignore Initial commit 2023-01-28 16:55:39 +02:00
.tool-versions Fix request options and make work on latest Gleam 2025-05-16 22:48:20 +03:00
CHANGELOG.txt Fix request options and make work on latest Gleam 2025-05-16 22:48:20 +03:00
gleam.toml Update minimum Gleam version 2025-05-16 22:49:07 +03:00
LICENSE Add LICENSE 2023-01-28 14:56:29 +00:00
manifest.toml Fix request options and make work on latest Gleam 2025-05-16 22:48:20 +03:00
README.md Fix request options and make work on latest Gleam 2025-05-16 22:48:20 +03:00

finch_gleam

Package Version Hex Docs

A wrapper/adapter package for the Finch HTTP client.

This library adapts the Finch functions to accept and return gleam/http requests and responses.

Installation

This package can be added to your Gleam project:

gleam add finch_gleam

and its documentation can be found at https://hexdocs.pm/finch_gleam.

Usage

import gleam/uri
import gleam/http
import gleam/http/request
import gleam/erlang/atom
import finch

let assert Ok(url) = uri.parse("https://example.com/")
let assert Ok(req) = request.from_uri(url)
let req = request.Request(..req, method: http.Post, body: "foo bar")

// Build Finch request from gleam/http request
let finch_req = finch.build(req)

// Run request with Finch, using Finch.Server, returns gleam/http response
let assert Ok(resp) = finch.request(finch_req, atom.create_from_string("Elixir.Finch.Server"), [])