When I retrieve the RSS data from SharePoint On Premise ,
when display at company laptop its work, but display at iPhone Safari its can't retrieve the data.
I had try different method, but at the end can't display the result.
Here with my source code.
string url = string.Format("{0}?List={1}", SPUrlUtility.CombineUrl(web.Url, "_layouts/15/listfeed.aspx"), list.ID);
var request = (HttpWebRequest)WebRequest.Create(url);
request.Credentials = CredentialCache.DefaultNetworkCredentials;
var response = (HttpWebResponse)request.GetResponse();
if (response.StatusCode == HttpStatusCode.OK)
{
using (var stream = response.GetResponseStream())
{
using (var reader = new StreamReader(stream))
{
result = reader.ReadToEnd();
}
}
result = Regex.Replace(result, @"<enclosure.+?/>", string.Empty);
}
The problems is happen at request.Credentials = CredentialCache.DefaultCredentials;,
any suggestion for authentication method, not the Network Credential method,
because its does not secure by using Network Credential.
Method I had use:
- CredentialCache.DefaultNetworkCredentials; - the status code "OK" but not display the result
- CredentialCache.DefaultCredentials; - the status code "OK" but not display the result
- NetworkCredential - this method not allowed in development & Production.