new EntityList()
A list of request or response entities.
The EntityList holds WebEntityRequest or WebEntityResponse objects.
For normal requests and responses, the entity lists are empty.
A multi-part request has entities rather than a body comprising a tree hierarchy.
Similarly, for a multi-part response you can either set the body or create entities.
Example
var i;
var cumulatedBody = "";
for (i = 0; i < $.request.entities.length; ++i) {
if ($.request.entities[i].body) {
cumulatedBody = cumulatedBody + $.request.entities[i].body.asString();
}
}
...
Members
-
length
-
The size of the entity list
Methods
-
create() → {$.web.WebEntityResponse}
-
Create a new entity. Creates a sub-entity in the current list of entities in EntityList. If a body was set using setBody(), it is removed. You can only create new entities for EntityLists of $.response and $.net.http.Request objects.
Throws:
Throws an error if the entity cannot be created on the objectReturns:
Returns a WebEntityResponse