// HOW-TO GUIDES

If you've got something to achieve, we've probably done it already.

Ready-made recipes for common use-cases - the required deps, the problem, and a fully runnable solution. Like a mini-StackOverflow, but you get the whole thing to adapt.

Arrange Filters into stacks A strategy for composing your applications http4k Core Authentication for HTTP services Recipes for how to secure and authenticate HTTP services http4k Core Cache a response with redis Using Redis as a response cache http4k Core Client as a function Recipes for using http4k to consume HTTP services http4k Core Configure an OAuth_Server Recipe for using http4k to create an authorization server that provides an *authorization code* access flow http4k Core Create a custom JSON marshaller Recipes for using JSON in http4k applications with a variety of popular JSON APIS http4k Core Customise a Server backend How to use write custom servers backends http4k Core Deploy WebJars Recipe for using WebJars with http4k http4k Core Implement your own clients How to implement your own clients for the Connect pattern http4k Connect Integrate with OpenAPI Recipes for using the http4k-api-openapi module to provide typesafe endpoints with automatically generated OpenAPI documentation http4k Core Leverage GraphQL Recipe for using GraphQL plugins http4k Core Lookup a user principal Recipes for looking up and populating a user principal from a request http4k Core Make HTTP calls in parallel Recipe to make HTTP calls in parallel using a ThreadPoolExecutor http4k Core Make JSON Faster Recipes to make JSON faster through the use of lighter reflection or code generation http4k Core Migrate from http4k 5.x to 6.x A user guide to upgrading from http4k 5.x to 6.x http4k Corehttp4k Connect Monitor http4k How to monitor http4k endpoints and applications http4k Core Pimp your Connect API Clients with KSP! How to use KSP to generate extension functions for your Connect clients http4k Connect Record and replay HTTP traffic Recipes for using http4k to record and replay HTTP traffic http4k Core Redoc and Swagger UI Create a Redoc or Swagger UI for your REST API http4k Core Request Contexts Recipes for using http4k with per-request context objects http4k Core Routing API (Advanced) Recipes for using the http4k composable routing API, including serving static content http4k Core Routing API (Simple) Recipes for using the http4k composable routing API http4k Core Self Document Systems with Tests Recipe for creating a Distributed Tracing Tree http4k Core Serve SSE Recipes for using http4k with Server-Sent Events http4k Core Serve Websocket Recipes for using http4k with websockets http4k Core Server-as-a-Function The simplest example of an http4k application http4k Core Structure your logs with Events Recipe for using http4k Events to send structured logs to external log sinks http4k Core Test using Service Virtualisation Implementing Service Virtualisation using Servirtium contracts http4k Core Typesafe your API with lenses Recipes for using the inbuilt http4k Lens API to marshall HTTP messages on and off the wire in a typesafe fashion http4k Core Use a custom OAuth provider Recipe for using http4k with custom OAuth provider http4k Core Use a Server backend Recipes for using http4k with the various Server backends http4k Core Use a templating engine Recipes for using server-side templating engines with http4k applications, including hot-reload functionality http4k Core Use Auto Content Negotiation Recipes for using the Auto Content Negotiation Lens to marshall and unmarshall HTTP messages of various formats http4k Core Use HTML Forms Recipes for using http4k with HTML forms http4k Core Use Multipart Forms Recipes for using http4k with Multipart forms http4k Core Write different test types Recipes for testing http4k applications http4k Core

Missing one?

http4k is community-driven. New and updated recipes are very welcome - just follow the recipe template.

Contribute a recipe
scarf