WS::payload

Description

WS::payload <length>

Returns the content that the WS::collect command has collected thus far, up to the number of bytes specified. If you do not specify a size, the system returns the entire collected content.

WS::payload <offset> <length>

Returns the content that the WS::collect command has collected thus far from the specified offset, up to the number of bytes specified.

WS::payload length

Returns the size of the content that has been collected thus far, in bytes.

WS::payload replace <offset> <length> <string>

Replaces the amount of content that you specified with the argument, starting at with , adjusting the frame length in frame header appropriately. The length argument should be the length of original content to replace. In order to replace the entire payload, the offset should be 0 and the length should be the original size in bytes of the payload.

Syntax

WS::payload (LENGTH | (OFFSET LENGTH))?

WS::payload length

WS::payload replace OFFSET LENGTH STRING

=

WS::payload (LENGTH | (OFFSET LENGTH))?
WS::payload length
WS::payload replace OFFSET LENGTH STRING=====

Valid During

WS_CLIENT_DATA WS_SERVER_DATA

Examples

when WS_CLIENT_FRAME {
     WS::collect frame 1000
     set clen 1000
 }

 when WS_CLIENT_DATA {
     regsub -all "oursite" [WS::payload] "oursitedev" newdata
     log local0. "Replacing payload with new data."
     WS::payload replace 0 $clen $newdata
     WS::release
 }

Change Log

@BIGIP-12.1 –First introduced the command.

The BIG-IP API Reference documentation contains community-contributed content. F5 does not monitor or control community code contributions. We make no guarantees or warranties regarding the available code, and it may contain errors, defects, bugs, inaccuracies, or security vulnerabilities. Your access to and use of any code available in the BIG-IP API reference guides is solely at your own risk.