Returning special ASCII characters in Web API

Viewed 409

I have a web api action method which returns an object.

Some of the properties in this object contain ASCII characters, specifically the bullet (ASCII character - 149 •)

When I call this api action all the bullet characters get replaced with •

Is there anyway I can change my api action to keep the bullets encoded as is?

[HttpGet]
public async Task<Candidate> Get(int id)
{    
    var manager = new CandidateManager(Country);
    Candidate candidate = await Task.FromResult(manager.Find(id));
    return candidate;
}
1 Answers

Add the following to your HTTP request header:

Content-Type: text/html; charset=utf-8
Related