set, request, body, item, api, request, response, send, soap, rest, get, post, put, delete

Method SetRequestBodyItem

API

Sets Request Body Item value

Watch this video to learn how to use this method

Have a problem with playback?
SetRequestBodyItem sets request body item value and name during script runtime. The input parameters are String name and string value, there is also optional boolean overwrite which should be True if we want to keep single Request body record or False to add a new item to the collection. By default it is True. Let's use ConcatArrayData. We can see 2 records in the Request Body list Let's add another one for the script runtime. We set name as "array.a:string" and value as "c", overwrite option should be False we will set a breakpoint then to pause the script during runtime Run and we can see new record appears in the Request Body list.

Usage

Function SetRequestBodyItem(
    String Name,
    String Value,
    Boolean Overwrite [Optional]
)

CreateBook

SetReq...dyItem

Author

Unknown

True

Name

Value

Overwrite

Parameters

Name

Type: String

The name of the Body Item

Value

Type: String

The new value to set (must be a string)

Overwrite (optional)

Type: Boolean

Default Value: True

True if keep only single Body Item name in a list, False to add a new item in a collection

Returns

No return value

Example

VBScript

Server("API Server").Method("CreateBook").SetRequestBodyItem "Author", "Unknown", True

JavaScript

Server("API Server").Method("CreateBook").SetRequestBodyItem("Author", "Unknown", true);

CreateBook

SetReq...dyItem

Author

Unknown

True

Contact Us

Tower Place 100

3340 Peachtree Rd NE #1800 

Atlanta, GA 30326 USA

(404) 814-5227