DataScript: avi.http.get_req_body
DataScript
Function | avi.http.get_req_body([size_in_kb]) |
Description | Returns the client request body. If no data exists within the request body — for example, if the request is not a POST — the function will return nil.
Notes 1. Enable `request_body_buffering` (via the Application Profile under the DDOS tab or in the Avi CLI). 2. Buffer size is specified in `client_max_body_size` but is limited to 32 MB maximum. 3. The default for `client_max_body_size` is 0, which is interpreted as unlimited, but limited to 32 MB. 4. To set `client_max_body_size`, use `http_profile` CLI command. |
Events | HTTP_REQ_DATA |
Parameter | size_in_kb: an optional parameter indicating the maximum payload in kilobytes to be returned. If not specified, the entire request payload is returned. Note that the maximum payload size that may be accepted by the virtual service could be limited by the HTTP profile's DDoS settings. |
Returns | If data exists, returns the data stored in the variable. Else returns nil. |
Version | 17.1+ |
Example | HTTP_REQ_DATA event:
body = avi.http.get_req_body(4) if string.match(body, "RandomString") then avi.http.response(404) end |