Vely logo install | documentation | examples | articles | changelog
16.6.0 released on Mar 08, 2023 | articles updated on Mar 20, 2023

request-body


Purpose: Get the body of an HTTP request.

request-body <request body> [ length [ define ] <body length> ]
request-body stores the request body of an HTTP request into string <request body> which can hold text or binary data and which is created for that purpose. In either case, optional "length" clause provides the length in bytes of the body in <body length> variable, which can be created with optional "define".

If the content type of the request is "multipart/form-data", the request body is empty because all the data (including any attached files) can be obtained by using input-param (see file_uploading for files). In all other cases, request body is available.

Typical use of request-body is when some text or binary information is attached to the request, such as JSON for example, though it can be anything else, for example an image, some text, or a PDF document. Usually request body is present for POST, PUT or PATCH requests, but you can also obtain it for GET or DELETE requests, if supplied (for instance identifying a resource may require more information than can fit in a query string), or for any custom request method.

Examples

String variable "reqb" will hold request body of a request and "reqb_length" will be its length in bytes:
request-body reqb length define reqb_length

See also

Request information ( get-req   input-param   request-body   set-input   set-req  )  SEE ALL (documentation)


Copyright (c) 2017-2023 DaSoftver LLC. Vely is a trademark of Dasoftver LLC. The software and information herein are provided "AS IS" and without any warranties or guarantees of any kind. Vely elephant logo (c) 2022 DaSoftver LLC. This web page is licensed under CC-BY-SA-4.0. Contact email vely@vely.dev.