Using predefined status responses without extending Http4sDsl
See original GitHub issueIs there an easy way to use use e.g. NotFound()
without extending Http4sDsl
?
I would imagine something like import import org.http4s.magic
and then magic.NotFound[IO]()
or magic.NotFound[F]()
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
The http4s DSL
Responding with a body. Simple bodies. Most status codes take an argument as a body. In http4s, Request[F] and Response[F] ...
Read more >http4s/http4s - Gitter
I'm on 0.16.16a, and I'm seeing this error while using the blaze client: java.util.concurrent.TimeoutException: Client response header ...
Read more >Unleashing the Power of HTTP Apis: The Http4s Library
The routes defined using the http4s DSL are composable. ... For example, the Ok() function creates a response with a 200 HTTP status:....
Read more >17 HTTP API with http4s - Get Programming with Scala
You'll discover how to implement an HTTP server that replies to a GET /ping request with a response with status code 200 –...
Read more >Error handling in Http4s with classy optics - Typelevel
I'll explain later in this post why it extends Exception . ... according http response and our code compiles without any warning whatsoever....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Let me make a draft PR and see how it feels 😃
Not saying we should do it, but the import trick specifically does work. I now follow, yes. You can have it scoped for the function, but you can’t import the values without explicitly doing so. We could however have a good space for a different dsl with the verbose syntax.
That being said, I prefer just building responses myself.