Product SiteDocumentation Site

1.8. Message Entities

It is possible for a HTTP request to contain a message entity. Use of POST or PUT methods often requires an additional message entity in the request:
POST /collection HTTP/1.1
Host: www.example.com
Accept: application/xml

<resource>
    <element>value</element>
</resource>
The message entity accepts a user-defined resource representation sent to the URI. POSTing this message entity creates a new resource with value in element to represent a resource setting. PUTing a message entity updates element in the resource with value. This means a user can define properties for new or existing resources using a resource representation in the message entity of a request. In the context of a Red Hat Enterprise Virtualization environment, an API user creates a new VM with the following request:
POST /rhevm-api/vms HTTP/1.1
Host: www.example.com
Accept: application/xml

<vm>
    <name>vm1</type>
    <description>vm1</description>
    <memory>536870912</memory>
    <cluster>
        <name>Default</name>
    </cluster>
    <template>
        <name>blank</name>
    </template>    
</vm>
A request result also uses an XML resource representation in the message entity to provide the user with the required abstracted information.