HTTP::Handler - Crystal 1.20.1

# module HTTP::Handler

##
Overview

A handler is a class which includes `HTTP::Handler` and implements the `#call` method. You can use a handler to intercept any incoming request and can modify the response. These can be used for request throttling, ip-based filtering, adding custom headers e.g.

NOTE To use `Handler`, you must explicitly import it with `require "http/server/handler"`

###
A custom handler

    require "http/server/handler"

    class CustomHandler
      include HTTP::Handler

      def call(context)
        puts "Doing some stuff"
        call_next(context)
      end
    end

##
Direct including types

- HTTP::CompressHandler
- HTTP::ErrorHandler
- HTTP::LogHandler
- HTTP::StaticFileHandler
- HTTP::WebSocketHandler

##
Defined in:

http/server/handler.cr

##
Instance Method Summary

- #call(context : HTTP::Server::Context)
- #call_next(context : HTTP::Server::Context) : Nil
- #next : Handler | HandlerProc | Nil
- #next=(next __arg0 : Handler | HandlerProc | Nil)

##
Instance Method Detail

abstract def call(context : HTTP::Server::Context) #
def call_next(context : HTTP::Server::Context) : Nil #
def next : Handler | HandlerProc | Nil #
def next=(next __arg0 : Handler | HandlerProc | Nil) #