简体   繁体   English

OData JSON Light是否仍返回元数据

[英]Is odata json light still returning metadata

I have a WCF Data Service that I am calling using datajs. 我有一个使用datajs调用的WCF数据服务。 When I make the request I supply the following headers. 当我发出请求时,我提供以下标题。 What I am getting back still has the __metadata in it which makes me wonder... Do I need to configure anything on the server? 我返回的内容中仍然包含__metadata,这使我感到奇怪...是否需要在服务器上配置任何内容? Is JSON light supported in 5.0.1.0? 5.0.1.0是否支持JSON light?

Headers: 标头:

request.headers = {
    "MaxDataServiceVersion": "3.0", 
    "Accept": "application/json;odata=light;q=1,application/json;odata=verbose;q=0.5"
};

WFC DS 5.0.1 doesn't support JSON Light. WFC DS 5.0.1不支持JSON Light。 And since your Accept header allows Verbose JSON to be used, it will be used. 并且由于您的Accept标头允许使用Verbose JSON,因此将使用它。 You can confirm this by looking at the Content-Type header of the response. 您可以通过查看响应的Content-Type标头来确认这一点。 We don't have publicly available bits with JSON Light support. 我们没有JSON Light支持的公开可用位。 We only have experimental service with current thinking of JSON Light. 我们仅在考虑JSON Light的当前思想的情况下提供实验性服务。 You can try it here: http://services.odata.org/Experimental/OData/OData.svc/ 您可以在这里尝试: http : //services.odata.org/Experimental/OData/OData.svc/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM