我被要求将RSS请求包装到ASP.NET WebAPI控制器中。最好的方法是什么?
答案 0 :(得分:1)
根据您的上一条评论,您可以执行以下操作:
public HttpResponseMessage Get()
{
HttpResponseMessage response = new HttpResponseMessage();
response.Content = new StreamContent(<Stream having xml content>);
// or
//response.Content = new StringContent("string having xml content");
response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/rss+xml");
return response;
}