Dancer2...re::HTTP(3)

πŸ’– Dancer2::Core::HTTP β€” the manual, but make it cute πŸ’–

okay bestie, so this is the page for Dancer2::Core::HTTP, and it lives in the User Contributed Perl Documentation section (section 3, the library-calls one, iykyk). It's a little helper that does one job and does it flawlessly: turning HTTP status codes into their names, names into codes, and generally being the translator between you and the HTTP status gods. πŸ¦‹


✨ NAME ✨

Dancer2::Core::HTTP β€” a helper for rendering HTTP status codes for Dancer2. that's it, that's the whole gig, and honestly? she ate. πŸ’…


πŸŽ€ VERSION πŸŽ€

version 2.2.1 β€” yes, that's the one you're looking at, no cap.


🌸 FUNCTIONS 🌸

these are the four besties in the group chat. let's meet them one by one. 🫢

πŸ’œ status(status_code)

so like, you hand her a status code and she gives you back the number. you hand her a name and she gives you the number for it. either way, number. ✨

Dancer2::Core::HTTP->status(200); # returns 200

Dancer2::Core::HTTP->status('Not Found'); # returns 404

Dancer2::Core::HTTP->status('bad_request'); # 400

Returns a HTTP status code. If given an integer, it will return the value it received β€” like, it literally just hands you back what you gave it, no thoughts, head empty, slay. Else it will try to find the appropriate alias and return the correct status. so 'Not Found' β†’ 404, 'bad_request' β†’ 400. iconic behaviour fr fr.

🌈 status_message(status_code)

the reverse vibe check. you give her a code, she tells you what that code is called. πŸ’–

Dancer2::Core::HTTP->status_message(200); # returns 'OK'

Dancer2::Core::HTTP->status_message('error'); # returns 'Internal Server Error'

Returns the HTTP status message for the given status code. notice how 'error' is a whole mood and maps straight to 'Internal Server Error' β€” relatable honestly. 😭

🧚 status_mapping()

this one dumps the entire table of status-name β†’ code. the whole thing. no crumbs left. πŸ‘‘

my %table = Dancer2::Core::HTTP->status_mapping;
# returns ( 'Ok' => 200, 'Created' => 201, ... )

Returns the full table of status -> code mappings. the ... is doing a lot of heavy lifting there but bestie, it's full, trust.

πŸ’œ code_mapping()

same energy, opposite direction. code β†’ status-name this time. πŸ”₯

my %table = Dancer2::Core::HTTP->code_mapping;
# returns ( 200 => 'Ok', 201 => 'Created', ... )

Returns the full table of code -> status mappings. it's giving mirror image, it's giving symmetry, it's giving perfection.

πŸ¦‹ all_mappings()

now THIS one? she's the main character. she takes everything and mashes it into one giant table. 🫢

my %table = Dancer2::Core::HTTP->all_mappings;
# returns ( 418 => 'I'm a teapot', "I'm a teapot' => 418, 'i_m_a_teapot' => 418 )

Returns the code-to-status, status-to-code and underscore-groomed status-to-code mappings all mashed up in a single table. Mostly for internal uses. so like… you can call her, but she's mostly clocking in for the internal girlies. 418 my beloved. πŸ“

ngl, that 'i_m_a_teapot' underscore-groomed variant is lowkey the cutest thing on this entire page and i will not be taking questions. πŸ’…

πŸ’… AUTHOR πŸ’…

Dancer Core Developers β€” the collective, the squad, the ones who made this happen. πŸŽ€


This software is copyright (c) 2026 by Alexis Sukrieh.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so like, go off, remix it, redistribute it, it's all yours bestie. 🌈


okay that's the whole page!! every function, every example, every mapping, nothing skipped, nothing invented β€” periodt. πŸ’–

this lil' cutie was brought to you by perl v5.42.3, dated 2026-09-20, and rendered from Dancer2...re::HTTP(3). mwah, love u, bye!! 🫢✨🌸

πŸ“¦ where this page comes from