HTTP::...kHeader(3pm)

✨ NAME ✨

HTTP::Headers::ActionPack::LinkHeader β€” bestie, it's A Link πŸ’…


πŸŽ€ VERSION πŸŽ€

version 0.09


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so here's the whole vibe, three ways to make one of these lil guys:

use HTTP::Headers::ActionPack::LinkHeader;

# build from string
my $link = HTTP::Headers::ActionPack::LinkHeader->new_from_string(
    '<http://example.com/TheBook/chapter2>;rel="previous";title="previous chapter"'
);

# normal constructor
my $link = HTTP::Headers::ActionPack::LinkHeader->new(
    '<http://example.com/TheBook/chapter2>' => (
        rel   => "previous",
        title => "previous chapter"
    )
);

# normal constructor, and <> around link are optional
my $link = HTTP::Headers::ActionPack::LinkHeader->new(
    'http://example.com/TheBook/chapter2' => (
        rel   => "previous",
        title => "previous chapter"
    )
);

🌸 DESCRIPTION 🌸

So like. This is an object. And the object represents an HTTP Link header. That's the whole thing, she's serving object-oriented realness πŸ’–

Most of the time you'll see her hanging out as a member of a HTTP::Headers::ActionPack::LinkList object β€” like she's in her little friend group, iconic, no notes 🫢


πŸ‘‘ METHODS πŸ‘‘

  • href

that's it, that's the method, that's the whole bullet ✨

  • new_from_string ( $link_header_string )

Hand her an HTTP header Link string and she'll parse it into an object for you. One string in, one object out. slay πŸ¦‹

  • as_string

This stringifies the link, and it respects the parameter order. She's not gonna rearrange your params, she's not that kind of girl πŸ’…

NOTE: okay so heads up bestie β€” this canonicalizes the header. Meaning: it's gonna add a space between each semicolon and quotes, and it unquotes all headers appropriately. So what comes out is not character-for-character what went in. That's just the deal, fr fr 😭

πŸ’œ AUTHOR πŸ’œ

Stevan Little <stevan.little@iinteractive.com> πŸŽ€


🌈 CONTRIBUTORS 🌈

  • Andrew Nelson <anelson@cpan.org>
  • Dave Rolsky <autarch@urth.org>
  • Florian Ragwitz <rafl@debian.org>
  • Jesse Luehrs <doy@tozt.net>
  • Karen Etheridge <ether@cpan.org>

the whole squad showed up, we love to see it πŸ”₯


This software is copyright (c) 2012 by Infinity Interactive, Inc.. ⭐

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. πŸ’–


and that's the whole page bestie, mwah πŸ’‹ β€” this was HTTP::...kHeader(3pm), perl v5.34.0, dated 2022-06-14, part of the User Contributed Perl Documentation. go forth and link things, ily 🫢✨

πŸ“¦ where this page comes from