Skip to content

Commit

Permalink
Add RestClientOptions option to RestSharpService
Browse files Browse the repository at this point in the history
  • Loading branch information
martijn-bol-com committed Jul 10, 2024
1 parent 5252da8 commit 59f8f11
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ApiLibs/General/Service.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ public abstract class RestSharpService : Service
protected RestSharpService(string hostUrl) : base(new RestSharpImplementation())
{
(Implementation as RestSharpImplementation).Client = new RestClient(hostUrl);
// (Implementation as RestSharpImplementation).Client = Client;
}

protected RestSharpService(RestClientOptions options) : base(new RestSharpImplementation())
{
(Implementation as RestSharpImplementation).Client = new RestClient(options);
}

protected void ConnectBasic(string username, string secret)
Expand Down Expand Up @@ -165,7 +169,7 @@ await MakeRequest(new Request(endPoint)
}
}

public class TooManyRetriesException : Exception {}
public class TooManyRetriesException : Exception { }

public class Request
{
Expand All @@ -186,8 +190,8 @@ public Request(string endPoint)
return Task.FromResult(resp);
};

Parameters = new ();
Headers = new ();
Parameters = new();
Headers = new();
ExpectedStatusCode = HttpStatusCode.OK;
}

Expand Down

0 comments on commit 59f8f11

Please sign in to comment.