Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Forward slash become %2F

I have this endpoint which has one string parameter. When I tested the name payload with "a / b", it becomes "a %2F b". I put a breakpoint at the action method to see it. How do I prevent / to become %2F? What I expected is the value will be still the same "a / b". This is because there is a slash symbol in someone’s name. If possible, I don’t want to use the replace method.

    public async Task<ActionResult> UpdateName(int id, string name)
    {
        // code is removed for brevity
    }

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I think you want something like UrlDecode ?

https://docs.microsoft.com/en-us/dotnet/api/system.web.httputility.urldecode?view=net-6.0#system-web-httputility-urldecode(system-string)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading