Follow the code below:
var token = "bHhETtde1UhKpwUVmTsNTpXZKyfZGK8/";
var token_string = Uri.EscapeDataString(token); //"bHhETtde1UhKpwUVmTsNTpXZKyfZGK8%2F"
HttpResponseMessage response = await client.GetAsync($"{URL}/api/getall/{token_string}");
ApiController:
public async Task<IHttpActionResult> GetAll (string token) {}
In parameter token
, receive bHhETtde1UhKpwUVmTsNTpXZKyfZGK8
and lost the bar.
How do I not lose " /
"?
Here are some examples of a token:
- pj / Wgche1UjjQG8i / MqaS5ZqGp3Ob1rn
- lk / lpohe1Ujjdftg + GuiS5ZqGp25b1rn
I use EscapeDataString
because of the character +
, /
, among others.
Do not allow special string.
Any solution?