Requesting metadata
Provision of metadata is OPTIONAL for SData Providers. If a Provider does support metadata, it MAY choose to provide consumers with metadata by default.
A consumer can specifically request metadata-enhanced responses through URL parameters as shown below:
GET http://www.example.com/sdata/myApp/-/-/products?**includeMetadata**=true GET http://www.example.com/sdata/myApp/-/-/products?**includePrototype**=true
In both examples, the response will be supplemented with metadata. In the second case, the metadata will take the form of an embedded $prototype object as explained in more detail in SData prototypes section.
The “include” parameters provide an efficient² manner for consumers to retrieve metadata.
In the case of prototypes, these may also be directly retrieved from links specified by the Provider, for example:
GET http://www.example.com/sdata/MyApp/-/-/$prototypes/addresses('detail')
The prototypes of an application are resources exposed under a $prototypes URL segment. While the complete URL delivering prototypes is a matter for the application, it is suggested that the $prototypes be located at the same level as resource kinds.
As discussed in SData prototypes section, a resource kind may expose several prototypes. These are returned as a JSON feed by a GET operation on the URL ending in $prototypes/resourceKindName.
For example, the following will retrieve a feed of $prototypes for the addresses resource kind:
GET http://www.example.com/sdata/MyApp/-/-/$prototypes/addresses
2. In this manner an additional round-trip to retrieve the prototype separately is avoided.