I'm trying to read a RSS generated by wordpress with full text activated. On firefox and IE9 an item data contains the element content:encoded
:
<content:encoded><![CDATA[bla bla bla]]></content:encoded>
but when in a C# program I request the same rss url this node is not present. I do my C# request like this:
WebClient client = new WebClient();
client.Encoding = Encoding.UTF8;
client.Headers.Add("Accept", "application/xml");
var xml = client.DownloadString(url)
Does I have to add an header to the request to have this specific field?
I'm guessing Wordpress is choosing the "wrong" output format based on your
Accept
header. Which feed is used is decided in/wp-content/feed.php
:so instead of
text/xml
, try acceptingapplication/rss+xml
.You don't need WebClient to download rss.
EDIT
The problem is related with compression. If the client doesn't support compression, then server doesn't send contents.