Back to directory
http4s avatar

http4s

A minimal, idiomatic Scala interface for HTTP. Read more below about its uses, features, and usage.

Clone repository

git clone https://github.com/http4s/http4s.git

2,626

Stars

814

Forks

71

Watchers

Apache-2.0

License

Http4s Build Status Maven Central Typelevel library Cats friendly

Http4s is a minimal, idiomatic Scala interface for HTTP services. Http4s is Scala's answer to Ruby's Rack, Python's WSGI, Haskell's WAI, and Java's Servlets.

val http = HttpRoutes.of {
  case GET -> Root / "hello" =>
    Ok("Hello, better world.")
}

Learn more at http4s.org.

If you run into any difficulties please enable partial unification in your build.sbt (not needed for Scala 2.13 and beyond, because Scala 2.13.0+ has partial unification switched on by default)

scalacOptions ++= Seq("-Ypartial-unification")

Requirements

Running the blaze backend requires a modern, supported version of the JVM to build and run, as it relies on server APIs unavailable before JDK8u252. Any JDK newer than JDK8u252, including 9+ is supported.

Code of Conduct

http4s is proud to be a Typelevel project. We are committed to providing a friendly, safe and welcoming environment for all, and ask that the community adhere to the Scala Code of Conduct.

License

This software is licensed under the Apache 2 license, quoted below.

Copyright 2013-2021 http4s [https://http4s.org]

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

[http://www.apache.org/licenses/LICENSE-2.0]

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Acknowledgments

YourKit

Special thanks to YourKit for supporting this project's ongoing performance tuning efforts with licenses to their excellent product.

Releases

This fixes a binary compatibility regression in the websocket package if http4s-core is newer than http4s-server. See #7887. What's Changed http4s-core

Restore binary compatibility of WebSocketFrame...

v1.0.0-M47

Pre-release

Jul 6, 2026

Download .zip

This is a security hardening release that comes as a result of two independent scans. Upgrades are strongly encouraged if you are:

Running Ember HTTP/2 Running behind an unhardened proxy Exposing we...

This is a security hardening release that comes as a result of two independent scans. Upgrades are strongly encouraged if you are:

Running Ember HTTP/2 Running behind an unhardened proxy Exposing we...

This release brings support for Scala Native 0.5. What's Changed http4s-core

Update Scala Native to 0.5.10 by @iRevive in #7708

http4s-client

Enhance the HMAC generation to be able to return ByteVe...

What's Changed http4s-core

fix: proxy authorization header instantiation with basic credentials by @tpetillot in #7742 Introduce MultipartReceiver for custom, fail-fast multipart decoding by @dylemma...