HTTP::AnyUA::Util(3)
β¨ NAME β¨
okay so bestie, this is HTTP::AnyUA::Util(3) β a User Contributed Perl Documentation page for the utility subroutines for HTTP::AnyUA backends and middleware. It's giving "little helper functions doing the behind-the-scenes work", and honestly? iconic. π
πΈ VERSION πΈ
version 0.904 π
π FUNCTIONS π
π coderef_content_to_string π
$content = coderef_content_to_string(\&code);
$content = coderef_content_to_string($content); # noop
Convert a coderef into a string of content by iteratively calling the coderef and concatenating the chunks it provides until the coderef returns undef or an empty string. If you pass in $content instead, it's a noop and just hands it right back. slay. β¨
π¦ native_to_http_request π¦
$http_request = native_to_http_request($method, $url);
$http_request = native_to_http_request($method, $url, \%options);
Convert a "native" request tuple to an HTTP::Request object. no cap, that's the whole vibe. π«Ά
π http_headers_to_native π
$headers = http_headers_to_native($http_headers);
Convert an HTTP::Headers object to a "native" hashref. cute. π
πΈ normalize_headers πΈ
$normalized_headers = normalize_headers(\%headers);
Normalize headers. Currently lowercases header keys. periodt. π
π₯ internal_exception π₯
$response = internal_exception($content);
$response = internal_exception($content, $response);
Create an internal exception response. If an existing response is passed, that response will have its fields modified to become an internal exception. lowkey important. π
π split_url π
($scheme, $host, $port, $path_query, $auth) = split_url($url);
Split a URL into its components: $scheme, $host, $port, $path_query, and $auth. iykyk. β
β http_date β
$http_date = http_date($epoch_time);
Convert an epoch time into a date format suitable for HTTP. iconic timezone-adjacent behavior. π°οΈ
π¦ parse_http_date π¦
$epoch_time = parse_http_date($http_date);
Convert an HTTP date into an epoch time. Returns undef if the date cannot be parsed. sad but true. π
π uri_escape π
$escaped = uri_escape($unescaped);
Escape a string for use in a URL query param or as "application/x-www-form-urlencoded" data. safety first, bestie. π₯
π§ www_form_urlencode π§
$bytes = www_form_urlencode(\%form_data);
$bytes = www_form_urlencode(\@form_data);
Encode a hashref or arrayref as "application/x-www-form-urlencoded" data. form data moment. π
π BUGS π
Please report any bugs or feature requests on the bugtracker website <https://github.com/chazmcgarvey/HTTP-AnyUA/issues>.
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. receipts help, bestie. π
π AUTHOR π
Charles McGarvey <chazmcgarvey@brokenzipper.com>
π COPYRIGHT AND LICENSE π
okay legal bestie moment: This software is copyright (c) 2019 by Charles McGarvey.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
periodt. π
okay bye bestie π«Ά this iconic little page is HTTP::AnyUA::Util(3), from perl v5.42.2, dated 2023-07-03. slay. π
β¨
π¦ where this page comes from
- alpine 3.24: perl-http-anyua-doc 0.904-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms