3.2.5.3.1 Executing a Received InsertEntity Request

In addition to the directives specified in sections Common Rules: Receiving Responses from Data Service Requests (section 3.1.5.1), Common Rules for Executing Received Insert, Update, or Delete Data Service Requests (section 3.2.5.2), and Executing a Received Insert Request (section 3.2.5.3), the directives defined in this section apply when executing an InsertEntity Request (section 2.2.7.1.1).

Any data in the request payload not required to complete the insert operation SHOULD be ignored by a data service. If a data service ignores a particular payload construct, the client MAY<72> omit the construct from the request payload.

If the entity represented in the request payload is an instance of an OpenEntityType, then the property values in the request payload, in addition to those that represent the values of declared properties on the OpenEntityType, MUST be treated as values of dynamic properties associated with the OpenEntityType instance being inserted.

In OData 1.0 and OData 2.0, if the insert succeeds in full, the server MUST return a response with a 201 (Created) status code and a response body that conforms to the syntax specified in InsertEntity Request (section 2.2.7.1.1). The response body MUST contain the values of the inserted resource after the server has executed all its server-specific data processing rules (validation, and so on). The server MAY alter the values of the resource received from the client before the resource is inserted on the server.

In OData 3.0, the response MAY have a 204 status code, as specified in [RFC2616], based on the client preference (see Prefer (section 2.2.5.9)) on the InsertEntity Request.