I am trying to use RestSharp’s AddUrlSegment to sub the token in a URL
ex: “www.test.com/{someToken}/Testing”
I am using this code:
string theToken = "someStringToken";
restRequest.AddUrlSegment("someToken",theToken);
This throws a NullReferenceException, when I try to execute the request.
Any ideas what I am doing wrong.
Thanks.
Alright I figured this out. The version of RestSharp I have (NUGET), apparently does not support the method above. Also the Resource property is the one that should be getting the url that is going to be replaced so the final code is something like this.
This piece of code works with the version I got from NUGET