Table of Contents

ConsumesAttribute Class

Defines the content type of the request body accepted by a service operation.

Remarks

By default service operations accept JSON. Use [Consumes('application/x-www-form-urlencoded')] to make the operation read its body parameters from a form-encoded request body instead. Requests with other content types are rejected with an unsupported media type error.

Syntax

Unit: XData.Service.Common

ConsumesAttribute = class(TCustomAttribute);

Constructors

Name Description
Create Creates the attribute with the given content type.

Properties

Name Description
ContentType Gets or sets the content type accepted by the service operation.