-2

I've got this customer who asked if it is possible to create an rss feed for the 2sxc news app. I'm wondering if this is possible in some way, or if anyone has set something like this up... I can kind of set up an api, which will return xml like output, but it still says: Feeds should not be served with the "application/json" media type

MBouwman
  • 45
  • 8
  • Just found out .... add using System.Net.Http and then create a standard httpresponse with returntypes etc. (var res = Request.CreateResponse(HttpStatusCode.OK); res.Content = new StringContent(sb.ToString(), System.Text.Encoding.UTF8, "text/xml"); return res;) – MBouwman Apr 29 '21 at 10:36

2 Answers2

0

Just found out .... add using System.Net.Http

and then create a standard httpresponse with returntypes etc.

var res = Request.CreateResponse(HttpStatusCode.Ok);
res.Content = new StringContent(sb.ToString(), System.Text.Encoding.UTF8, "text/xml");
return res;
MBouwman
  • 45
  • 8
0

That's the spirit :). BTW: In 2sxc 12 we're adding new helpers to stream file results. YOu should then be able to just create an api and return File(contents: xmlObject). Almost done...

iJungleBoy
  • 5,325
  • 1
  • 9
  • 21