Hello Everyone ,
In a following post we will see how to resolve "XMLHttpRequest: Network Error 0x2eff, Could not complete the operation due to error 00002eff. " error.I got this error while I am developing SharePoint hosted Apps .
I am using REST API to get the values from the List, code as follows,
function getItems_List(SPAppWebUrl, SPHostUrl) {
In a following post we will see how to resolve "XMLHttpRequest: Network Error 0x2eff, Could not complete the operation due to error 00002eff. " error.I got this error while I am developing SharePoint hosted Apps .
I am using REST API to get the values from the List, code as follows,
function getItems_List(SPAppWebUrl, SPHostUrl) {
var url = SPAppWebUrl + "/_api/SP.AppContextSite(@target)" + "/web/lists/getbytitle('ListName')/items?" + "@target='" +
SPHostUrl + "'";
var executor = new SP.RequestExecutor(SPAppWebUrl);
executor.executeAsync({
url: url,
method: "GET",
headers: { "Accept": "application/json;odata=verbose" }, // return data format
success: onQuerySuccess,
error: onQueryError
});
}
There is invalid mime or bad character set being sent with our json data causing the error.Adding the charset like this helped me to resolve the issue.
Resolution:
function getItems_List(SPAppWebUrl, SPHostUrl) {
var url = SPAppWebUrl + "/_api/SP.AppContextSite(@target)" + "/web/lists/getbytitle('ListName')/items?" + "@target='" +
SPHostUrl + "'";
var executor = new SP.RequestExecutor(SPAppWebUrl);
executor.executeAsync({
url: url,
method: "GET",
headers: { "Accept": "application/json;odata=verbose;charset=utf-8" }, // return data format
success: onQuerySuccess,
error: onQueryError
});
}
Thanks.
Related Post
REST API
- Internet Explorer cannot display this feed - while accessing REST URL in SharePoint
- Get the Items inside the Folder in document Library in SharePoint 2013 using REST API
- Add Attachment to the List Item Using REST API in SharePoint
- Insert Items into List by using REST API in SharePoint 2013
- Read List Items using REST API
Apps.SharePoint 2013
- Get List Field Type using ECMA Script in SP Hosted Apps
- SharePoint 2013 AppModel Basics
- Something Went wrong error message while deploying App in SharePoint 2013
- Create Content Type using ECMA Script
- Get List Content Types using ECMA Script
- Get Lookup Column Value using ECMA Script
- Create Folder in document Library using ECMA Script in SharePoint Hosted Apps
- Remove an App from SharePoint Site
- Delete List Item Collection using ECMA Script
- Get List Item attachments using ECMA Script
- Create SharePoint Hosted App in SharePoint 2013
- 101 New Features of Share Point 2013
- Creating Apps in SharePoint 2013
0 comments:
Post a Comment