httpd_custom_api — inets v9.7

Search documentation of inets

# httpd_custom_api behaviour (inets v9.7)

Copy Markdown View Source

Behaviour with optional callbacks to customize the inets HTTP server.

The module implementing this behaviour shall be supplied to to the servers configuration with the option customize

## Summary

### Callbacks

request_header/1

Filter and possible alter HTTP request headers before they are processed by the server.

response_default_headers()

Provide default headers for the HTTP servers responses. Note that this option may override built-in defaults.

response_header/1

Filter and possible alter HTTP response headers before they are sent to the client.

## Callbacks

# request_header/1

(since OTP 17.5.6) (optional)

    -callback request_header({Key :: string(), Value :: string()}) ->
                                {true, {Key :: string(), Value :: string()}} | false.

Filter and possible alter HTTP request headers before they are processed by the server.

# response_default_headers()

(since OTP 18.1.1) (optional)

    -callback response_default_headers() -> [{Key :: string(), Value :: string()}].

Provide default headers for the HTTP servers responses. Note that this option may override built-in defaults.

# response_header/1

(since OTP 17.5.6) (optional)

    -callback response_header({Key :: string(), Value :: string()}) ->
                                 {true, {Key :: string(), Value :: string()}} | false | {true, string()}.

Filter and possible alter HTTP response headers before they are sent to the client.