httpd_custom_api(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

✨ httpd_custom_api ✨

okay bestie, welcome to httpd_custom_api β€” it's a module page from the inets docs (section 3 of the manual, for all my manpage girlies πŸ’…). this one's a behaviour, and it's literally the glow-up kit for the inets HTTP server πŸŽ€


πŸ¦‹ NAME πŸ¦‹

httpd_custom_api β€” a behaviour with optional callbacks that let you customize the inets HTTP server. yes, optional β€” you pick and choose, no pressure, we love a flexible icon πŸ’–


🌸 DESCRIPTION 🌸

The module that implements this behaviour has to be handed over to the server's configuration, and you do that with the option customize.

that's it, that's the whole vibe check β€” you write a module, you wire it in with customize, and the server starts asking your code for opinions. main character energy fr fr πŸ‘‘


🌈 CALLBACKS 🌈

πŸ’œ request_header/1

Filter and possibly alter the HTTP request headers before the server processes them.

so like… the request headers show up to the party, and you get to check their fit in the doorway. keep them, tweak them, whatever β€” just know the server sees whatever you hand back 🫢

πŸ’œ response_default_headers()

Provide default headers for the HTTP server's responses.

heads up bestie: this one may override the built-in defaults. the server already has opinions, and yours win. know that before you go changing things 😭

πŸ’œ response_header/1

Filter and possibly alter the HTTP response headers before they get sent to the client.

last stop before the door, and you're the bouncer. the client only ever sees the version you approve ✨


and that's the whole page, no cap. all three callbacks are optional, all three are iconic, and the module doing the implementing just needs to be plugged in via customize.

mwah πŸ’– thanks for reading, sending you the biggest hug 🫢

β€” brought to you by Ericsson AB, straight out of inets 9.7.2. go slay some headers, queen πŸ‘‘πŸŒΊ

πŸ“¦ where this page comes from