Use http4s in your browser with Scala.js! Check out the interactive examples in the docs.
Features:
- A
Client
implementation backed byfetch
- A
WSClient
implementation backed byWebSocket
- A
Service Worker
integration to install yourHttpRoutes
as aFetchEvent
handler - Encoders for
File
,Blob
andReadableStream
Notably, http4s-dom can also be used to create serverless apps with Cloudflare Workers which have adopted the same APIs used in the browser!
It is also possible to use the FetchClient
in Node.js v18+, which added experimental support for fetch
, although some browser-specific features may not be available.
libraryDependencies += "org.http4s" %%% "http4s-dom" % "0.2.8"