RESTAPIRequestBody - Scoped, Global

A RESTAPIRequestBody object allows you to access the body content of a scripted REST API request in scripts.

The format of a RESTAPIRequestBody object may be JSON or XML, depending on the content-type header value from the request.
Note: You cannot instantiate objects of this type. Objects of this type are created automatically and are accessible only in scripted REST API resource scripts.
Single entry example-request-body in JSON format.
{
 "name": "user1",
 "id": 1234,
 "roles": [
  {
   "name": "admin"
  },
  {
   "name": "itil"
  }
 ]
}
Multiple entry example-request-body in JSON format.
[{
 "name": "user1",
 "id": 1234,
 "roles": [
  {
   "name": "admin"
  },
  {
   "name": "itil"
  }
 ]
},{
 "name": "user2",
 "id":9876,
 "roles": [
  {
   "name":"admin"
  }
 ]
}]
Important: If the request body format is not Application/json, Application/xml, or Text/xml, use only the request body dataStream field to access the request body. Using request body data, dataString, nextEntry(), or hasNext() with a non-default format will result in a 500 error response.