I am facing issue when I pass a parameter which contains /
in it; the url will assume as separate route and eventually request fails.
For example – this is my endpoint:
http://domainname/ErpProductCount/{StockName}
and url will be
http://domainname/ErpProductCount/DIN-SMS-60/90SP
Here, DIN-SMS-60/90SP
is the name of stock but url consider it as a separate path.
I tried using the EscapeDataString
method:
var encodedStockName = Uri.EscapeDataString(StockName);
But it doesn’t work.
BTW, I am working in a C# project.