'RestSharp baseUrl with a space
I google it and I pass hours try figure how to do it and I can't figure: I try get Response from web Api with RestSharp v107 in .net 5 Is works well when I do the baseUrl with out space but when I try the one I need with space don't works, I got 404 not found: Same issue in postman. But when I do in Chrome or in edge with the code encoding (%20) works perfectly the browser return the expected Json
example :
new Resclient("https://thedomain.name.com/local")
works well
but if I try
new Resclient("https://thedomain.name.com/my User")
or
new Resclient("https://thedomain.name.com/my%20User")
I try the with the .AddUrlSegment("elemement", "my%20User" ) or .AddUrlSegment("elemement", "my%20User" )
I think the issue is the url get decode/encode and the space have been remove...
I see we have
UseUrlEncoder(Func<string,string>)
but I don't how to use it... And if that will solve my issue
Please helps
Thanks in advance
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|