http_uri(3)

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

✨ NAME ✨

okay so bestie, this is http_uri β€” it's the old URI utility module, and the whole point of this page is: use uri_string instead. that's it, that's the tea πŸ’…


🌸 DESCRIPTION 🌸

ngl this module is deprecated since OTP 23. like, it's giving "retired icon living her best life". the move is to use the module uri_string to properly handle URIs β€” that's the recommended one and it's been the moment since OTP 21. so if you're starting something new, uri_string is the main character and http_uri is the nostalgic cameo 🫢

πŸ’– Data types

here's the type definitions that are related to URI:

  • uri_part() = [byte()] | binary() β€” syntax according to the URI definition in RFC 3986, for example, "http://www.erlang.org/". so yeah, a list of bytes OR a binary, your choice, slay ✨

for more info about URI, see RFC 3986. iykyk, it's the source of truth πŸ“œ


πŸ”₯ FUNCTIONS πŸ”₯

decode(QuotedData) -> Data

when:

  • QuotedData :: unicode:chardata()
  • Data :: unicode:chardata()
Deprecated: http_uri:decode/1 is deprecated; use uri_string:unquote function instead 😭

it decodes a possibly percent encoded URI part. so like, %20 comes in, a space comes out, glow-up complete πŸ¦‹

WARNING: Use uri_string:unquote/1 instead. fr fr, don't come for this one πŸ™ˆ

encode(Data) -> QuotedData

when:

  • Data :: unicode:chardata()
  • QuotedData :: unicode:chardata()
Deprecated: http_uri:encode/1 is deprecated; use uri_string:quote function instead 😭

it performs percent encoding. so a space goes in, %20 comes out, literally the reverse makeover πŸ’€

WARNING: Use uri_string:quote/1 instead. bestie i'm begging you, uri_string is right there πŸŽ€

okay that's the whole page, mwah πŸ’‹ this one came from Ericsson AB, it's part of inets 9.7.2, and yeah it's http_uri(3) β€” deprecated queen, we still love her, but go use uri_string instead πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from