mercredi 27 septembre 2017

Web Api not decoding escaped characters

My Web Api 2.0 API controller does not automatically decode escaped characters.

For Example:

    [Route("Search")]
    [HttpGet]
    public IHttpActionResult Search(string test)
    {
        var response = mediator.Send(test);
        return Ok(response.Result);
    }

When I send blabla/api/search?test="%20" to my web api the paramater test returns "%20". But normally it should give " " (a space).

The same situation when I'm working with [FromUri]

Does anyone have an idea?

Thanks in advance!




Aucun commentaire:

Enregistrer un commentaire