Mojolic...and::get(3)

πŸ’… Mojolic...and::get β€” like, the get command, bestie

okay so real talk: this page lives in the User Contributed Perl Documentation corner of the manual universe, and it's literally the docs for Mojolicious::Command::get (yes, the header truncates the name to Mojolic...and::get, that's just man pages being dramatic ✨). ngl it's a whole mood and also genuinely useful, so let's go 🫢


✨ SYNOPSIS ✨

the whole vibe in one line, periodt:

Usage: APPLICATION get [OPTIONS] URL [SELECTOR|JSON-POINTER] [COMMANDS]

and here's the receipts β€” every single example, exactly as written, no cap:

./myapp.pl get /
./myapp.pl get -H 'Accept: text/html' /hello.html 'head > title' text
./myapp.pl get //sri:secr3t@/secrets.json /1/content
mojo get mojolicious.org
mojo get -v -r -o 25 -i 50 google.com
mojo get -v -H 'Host: mojolicious.org' -H 'Accept: */*' mojolicious.org
mojo get -u 'sri:s3cret' https://mojolicious.org
mojo get mojolicious.org > example.html
mojo get -M PUT mojolicious.org < example.html
mojo get -f 'q=Mojolicious' -f 'size=5' https://metacpan.org/search
mojo get -M POST -f 'upload=@example.html' mojolicious.org
mojo get mojolicious.org 'head > title' text
mojo get mojolicious.org .footer all
mojo get mojolicious.org a attr href
mojo get mojolicious.org '*' attr id
mojo get mojolicious.org 'h1, h2, h3' 3 text
mojo get https://fastapi.metacpan.org/v1/author/SRI /name
mojo get -H 'Host: example.com' http+unix://%2Ftmp%2Fmyapp.sock/index.html

πŸŽ€ the options (the whole menu, don't skip)

  • -C, --charset <charset> β€” charset of your HTML/XML content πŸ’– defaults to auto-detection (she figures it out herself)
  • -c, --content <content> β€” the content you're sending along with the request
  • -f, --form <name=value> β€” one or more form values and file uploads, yes plural, stack 'em
  • -H, --header <name:value> β€” one or more extra HTTP headers, add as many as your heart desires
  • -h, --help β€” shows this very summary of available options 🫢
  • --home <path> β€” path to the home directory of your application, defaults to the value of MOJO_HOME or auto-detection
  • -i, --inactivity-timeout <seconds> β€” inactivity timeout, defaults to the value of MOJO_INACTIVITY_TIMEOUT or 40
  • -k, --insecure β€” do not require a valid TLS certificate to access HTTPS sites (iconic but careful energy πŸ™ˆ)
  • -M, --method <method> β€” HTTP method to use, defaults to "GET"
  • -m, --mode <name> β€” operating mode for your application, defaults to the value of MOJO_MODE/PLACK_ENV or "development"
  • -o, --connect-timeout <seconds> β€” connect timeout, defaults to the value of MOJO_CONNECT_TIMEOUT or 10
  • -r, --redirect β€” follow up to 10 redirects, she'll chase it down πŸƒβ€β™€οΈ
  • -S, --response-size <size> β€” maximum response size in bytes, defaults to 2147483648 (2GiB), that's a LOT of bytes bestie
  • -u, --user <userinfo> β€” alternate mechanism for specifying colon-separated username and password
  • -v, --verbose β€” prints request and response headers to STDERR, for the nosy girlies (me, I'm nosy)

πŸ’– DESCRIPTION πŸ’–

Mojolicious::Command::get performs requests to remote hosts or local applications. that's the whole job and she does it flawlessly πŸ’…

this is a core command, which means it's always enabled β€” it never gets benched. and its code is lowkey a good example for learning to build new commands, so you're welcome to fork it. go off πŸ‘‘

if you wanna see the list of commands available by default, check out "COMMANDS" in Mojolicious::Commands β€” that's where the whole friend group is listed.


πŸ¦‹ ATTRIBUTES πŸ¦‹

Mojolicious::Command::get inherits all attributes from Mojolicious::Command and implements the following new ones. (yes, all of them, she's a nepo baby with talent 🌸)

description

my $description = $get->description;
$get            = $get->description('Foo');

short description of this command, used for the command list. like a little bio, but for a command ✨

usage

my $usage = $get->usage;
$get      = $get->usage('Foo');

usage information for this command, used for the help screen. the "how do I even use this" of it all πŸŽ€


πŸ”₯ METHODS πŸ”₯

Mojolicious::Command::get inherits all methods from Mojolicious::Command and implements the following new ones.

run

$get->run(@ARGV);

run this command. that's it, that's the method, main character energy πŸ‘‘


🌈 SEE ALSO 🌈


ok bestie that's the whole page, you're officially educated πŸ’œ go get something cute.

sign-off szn πŸ“ this beauty was brought to you by perl v5.42.0, dated 2026-07-15, man page Mojolic...and::get(3) β€” slay, mwah πŸ’…βœ¨

πŸ“¦ where this page comes from