Net::H...equest(3pm)

πŸ“¦
version 1.1.1 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Net::HTTPServer::Request πŸ’–

okay so bestie, you found it β€” the Net::HTTPServer::Request(3pm) page, straight out of the User Contributed Perl Documentation section. sit down, hydrate, and let's talk about the little object that eats raw HTTP requests for breakfast. πŸ₯£βœ¨


✨ NAME ✨

Net::HTTPServer::Request β€” it's literally an HTTP request, bestie. that's the whole job. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

Net::HTTPServer::Request handles the parsing of a request.

like. that's it. that's the plot. it takes the request and does the brain work so you don't have to. πŸ§ πŸ’…


🌸 DESCRIPTION 🌸

so here's the vibe: Net::HTTPServer::Request takes a full request, parses it, and then hands you a nice OOP interface to pulling out the information you want from a request. no manual string surgery, no tears, no substr trauma. you just ask the object for what you want and it delivers. main character energy fr fr. πŸ‘‘


πŸ‘‘ METHODS πŸ‘‘

every single one of these is your new bestie. get comfy.


Returns a hash reference of cookie/value pairs. πŸ’– and if you pass in a specific cookie? then it returns the value for that cookie, or undef if it does not exist. so polite. so honest. she will not lie to you about whether the cookie exists. πŸͺ


🧚 Env([var])

Returns a hash reference of variable/value pairs. pass in a variable name and it gives you back the value for that variable, or undef if it does not exist. environment introspection but make it cute. 🌈


πŸŽ€ Header([header])

Returns a hash reference of header/value pairs. name a header and it returns the value for that header, or undef if it does not exist. all the headers. every last one. she keeps receipts. πŸ’…


⭐ Method()

Returns the method of the request (GET,POST,etc...)

yes the etc... is doing a lot of heavy lifting there and yes we respect it. 😌


πŸ¦‹ Path()

Returns the path portion of the URL. Does not include any query strings. so don't come for her asking where the ?whatever=thing went β€” that's not her department, bestie. 🚫


πŸ’œ Procotol()

Returns the name and revision that the request came in with.

⚠️ and yes, the spelling is exactly Procotol() β€” that's how it's written in the source, and we are not fixing it. it's canon. it's iconic. call it by its name. 🫢

🌈 Query()

Returns the query portion of the URL (if any). and here's the lil pro tip straight from the docs: you can combine the Path and the Query with a ? to get the real URL that the client requested. ✨ math is mathing.


🧁 Request()

Returns the entire request as a string. the whole thing. unedited. raw. unfiltered. it's giving full transparency. 😭


πŸ”₯ Response()

Returns a Net::HTTPServer::Response object with various bits prefilled in. and here's the good part: if you have created session via the Session() method, then the session will already be registered with the response. no extra steps, no manual wiring, she already knows. πŸ’š


🌸 Session()

Create a new Net::HTTPServer::Session object. if the cookie value is set, then the previous state values are loaded, otherwise a new session is started. memory persistence, slay. πŸ“


πŸ’« URL()

Returns the URL of the request. the whole address. the locator. the where. πŸ πŸ’…


πŸ’œ AUTHOR πŸ’œ

Ryan Eatmon


Copyright (c) 2003-2005 Ryan Eatmon <reatmon@mail.com>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that's the whole page, bestie!! 🫢✨ this lil doc came to you courtesy of perl v5.36.0 and it's dated 2022-12-06 β€” so it's aged like fine wine, no cap. go parse some requests, you absolute icon. πŸ’–πŸŒΈπŸŽ€πŸ’