-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
Description
Is your feature request related to a problem? Please describe.
Creating new RestRequest(HttpClient)
will not use HttpClient base address and fails if you try execute request like this: new RestRequest("GetAll")
with message:
System.ArgumentOutOfRangeException : Request resource doesn't contain a valid scheme for an empty base URL of the client (Parameter 'request')
Describe the solution you'd like
make new RestRequest(HttpClient)
ctor automatically assign HttpClient.BaseAddress
to RestClient.Options.BaseUrl
Describe alternatives you've considered
var httpClient = new HttpClient() { BaseAddress = new Uri("https://localhost:1234/api/Product/v1/") };
var client = new RestClient(httpClient, new RestClientOptions(httpClient.BaseAddress));
Additional context
If there is a good reason for not doing this automatically, perhaps just update the error message describing this?
hypnot1c