I am making a get request through postman and when the request reaches my controller, the characters like "+" are converted to empty spaces " ". The api is written in c#.
My controller code is:
[RoutePrefix("")]
public partial class _DesifrarCusController : CaramlController, I_DesifrarCusController
{
[HttpGet]
[Route("descifrarCus")]
public IHttpActionResult GetDescifrarCusResponse( [FromUri] string cus = null ) {
return Ok (ExecGetDescifrarCusResponse(cus));
//return Ok();
}
}
Does anyone have any idea what postman is doing with the request string?
I have tried to send the string between quotes and with ascii characters and still the problem persists.
You need to encode the parameter on Postman. First add the parameter under Params
tab
then select the value and right click the value chose EncodeURIComponent
then you will get encoded parameter
Reference: https://learning.postman.com/docs/sending-requests/requests/