使用REST api调用时,并非所有属性都从列表返回 [英] Not all properties returned from list when using REST api call

查看:92
本文介绍了使用REST api调用时,并非所有属性都从列表返回的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用REST api进行调用以返回一些列表数据。  数据结果中缺少某些属性。  具体来说,我正在尝试从图片库中返回数据。  我库中的所有商品都会被退回。我注意到
返回图片库项目中的标题,描述和关键字;但是,不会返回名称和URL。  根据OData文档,URL应位于__metadata.media_src中,但不会返回此属性。  这是
我的代码的一部分

I'm using the REST api to make a call to return some list data.  Some properties are missing from the data result.  Specifically, I'm attempting to return data from a picture library.  All of my items in my library are returned. I noticed that the Title, Description and Keywords from the picture library items are returned; however, the Name and URL are not returned.  Per the OData documentation, the URL should be in __metadata.media_src, but this property is not returned.  Here is part of my code

$.ajax({ headers: { "Accept": "application/json;odata=verbose" }, contentType: 'application/json', url: "../_api/web/lists/getByTitle('Landscape')/items", success: function (data, textstatus, jqXHR){ for (index in data.d.results) { var result = data.d.results[index];

}

}

});

当我查看"结果"对象,我找不到"名称"或"__ metadata.media_src"。  我错过了什么吗?  如何获取其他属性?

When I view the "result" object, I can't find "Name" or "__metadata.media_src".  Am I missing something?  How can I get those other properties?

我正在将此代码部署到Office 365 SharePoint 2013网站。

I am deploying this code to an Office 365 SharePoint 2013 site.

谢谢。

标记




推荐答案

嗨Mark,

您能否发送请求的网络跟踪,响应循环以便检测问题。

Can you send the network trace for the request, response cycle in order to detect the problem.

您可以使用像fiddler这样的网络调试器来检测请求和响应。

You can use a network debugger like fiddler to detect the request and response.

----

问候,

侯赛因


这篇关于使用REST api调用时,并非所有属性都从列表返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆