带有空间的Restsharp baseurl
我谷歌搜索它,然后通过数小时尝试如何做,但我无法弄清楚: 我尝试通过RESTSHARP V107在.NET 5中获得Web API的响应 当我在空间空间的底座上做底车时,工作效果很好,但是当我尝试使用空间不起作用的空间时,我找不到404:找不到: 邮递员同样的问题。但是,当我在Chrome或Edge中使用代码编码(%20)时,浏览器返回预期的JSON
示例: new Resclient(“ https://thedomain.name.com/local”)
效果很好 但是如果我尝试 new resclient(“ https://thedomain.name.com/my user”)
或
new Resclient("https://thedomain.name.com/my%20User")
我尝试使用.addurlsegment(“ Elemement”,“我的%20user”) 或.addurlSeggent(“ ellemement”,“我的%20user”)
我认为问题是URL获取解码/编码,并且空间已被删除...
我看到我们有
UseUrlEncoder(Func<string,string>)
,但我没有如何使用它...如果那能解决我的问题,
请
提前感谢您
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 trynew 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论