N
N
Nikita072021-06-21 13:01:18
ASP.NET
Nikita07, 2021-06-21 13:01:18

How to return xml markup?

Hello everyone, the question is as follows: It is
necessary to return the response in the form of XML markup from the ASP.NET Core program.
I did something like this, but the xml markup could not be returned, help me figure out what my mistake is?

HttpResponseMessage response = null;
response = new HttpResponseMessage(HttpStatusCode.OK)
{
    Content = new StringContent(result, System.Text.Encoding.UTF8, contentType.ToString())
};
return response;

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question