Web Api 2 routing issue with special characters in URL

前端 未结 2 1671
广开言路
广开言路 2021-01-21 11:19

In the middle of developing a Web Api 2 REST service, we have discovered a routing problem. The endpoint is as follows:

.../{email}/...

The problem is that the e

相关标签:
2条回答
  • 2021-01-21 11:36

    UrlEncodeUnicode and UrlDecode should be helpfull in your case.

    0 讨论(0)
  • 2021-01-21 11:45

    No, encoding and deconding can only work if yyou're in control of the client and server operations. If otherwise, the best way is to call the endpoint as such

    www.yourwebsite.com/api/account/create?email='{email with any characters}'

    0 讨论(0)
提交回复
热议问题