Closed PetesBreenCoding closed 3 months ago
Looking at the code, I can do this, but not ideal:
var originalBaseAddress = httpClient.BaseAddress;
httpClient.BaseAddress = new Uri("...");
var wpClient = new WordPressClient(httpClient);
httpClient.BaseAddress = originalBaseAddress;
I'm not against making this more flexible. Can't promise if I can get to it soon, but happy to look at a PR.
done
Hi , should it really be necessary to set a BaseAddress if passing a HttpClient instance to the constructor? If I want to re-use a HttpClient instance in multiple places (including for non-WordPress uses) then setting a BaseAddress limits that. Would it not be better to take the HttpClient and base URL separately?