GOLF(2gg)

πŸ“¦ version 601.4.41, in ubuntu questing

πŸŽ€ NAME

request-body β€” it's giving (request-data) πŸ’…


πŸ’– PURPOSE

Bestie, we're grabbing the body of an HTTP request. That's it. That's the whole job. ✨


🌸 SYNTAX

request-body <request body>

πŸ¦‹ DESCRIPTION

Okay so request-body takes the body of an HTTP request and tucks it into the string <request body>. Iconic, no notes. πŸ’–

Now here's the tea: if the content type of the request is "multipart/form-data", the request body comes back empty. Not a glitch, not a bug β€” it's because literally all the data (including any attached files, yes even those) can be snagged using get-param instead (peep file-uploading if you're here for the files πŸ“Ž). In every other case? The request body is available. Periodt.

Typical use of request-body is when some text or binary info is attached to the request β€” JSON is the classic example, but honestly it can be anything else, like an image, some text, or a PDF document. The vibes are flexible. 🌈

Usually the request body is present for POST, PUT or PATCH requests, but you can also obtain it for GET or DELETE requests if it's supplied (for instance, identifying a resource may require more information than can fit in a query string, iykyk), or for any custom request method you feel like inventing. Main character energy, truly. πŸ‘‘


πŸ”₯ EXAMPLES

String variable "reqb" will hold request body of a request:

request-body reqb

πŸ‘‘ SEE ALSO

  • Request data
  • get-param
  • request-body
  • set-param
  • See all documentation

That's the whole page, bestie β€” go slay some HTTP requests 🫢

Cute little sign-off: this was $VERSION, dated $DATE, and yeah it's from GOLF(2gg), Development section. Mwah. πŸ’‹

πŸ“¦ where this page comes from