0

I am posting a base64encode string to my asp.net-webapi such as "PHA+ZHNmYWFzZGYgZDxzcGFuIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiByZ2IoMjU1LCAyNTUsIDApOyI+c2FmYWRzZjwvc3Bhbj48L3A+"

But... the api only receives the string as following "PHA ZHNmYWFzZGYgZDxzcGFuIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiByZ2IoMjU1LCAyNTUsIDApOyI c2FmYWRzZjwvc3Bhbj48L3A " with '+' character repleced by ' '.

[Route("api/Test/TestFuncCall")]
[HttpPost]
public HttpResponseMessage TestFuncCall([FromBody] string input)
{
    JObject jo = JObject.Parse(input);
    string data = Convert.ToString(jo["data"]);
    string c = System.Text.Encoding.GetEncoding("utf-8").GetString(Convert.FromBase64String(data));
    return Request.CreateResponse(HttpStatusCode.OK, c);
}

I've tried to add <pages validateRequest="false"/> to my web.config. But not working.

How to get the full base64encode string without any filter?

artista_14
  • 674
  • 8
  • 22

0 Answers0