I had to make this change because it seems that Mono's HttpClient uses SendAsync, which eventually winds up in CreateWebRequest. While HttpClient's SendAsync is aware of BaseAddress, HttpClientHandler's CreateWebRequest is not, and thus creates a new request object that is lacking the base address at the front of the request uri.
Work around is simple... I don't know enough about HttpClientHandler, but I'm wondering if CreateWebRequest should take BaseAddress into account and either set an appropriate value on the constructed HttpWebRequest, or add it to the request uri during construction.
It works for me with mono master and it should work with mono 3.12 as well. Relevant code is at https://github.com/mono/mono/blob/master/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs#L250
The test that I referenced, was passing under .NET CLR but was failing under mono 3.12 until I added the indicated work around.
The error received was this one:
That's different issue, could you track down what the values of BaseAddress and request uri were in the failing case?
Here's more information, showing mono 3.12 and my test, with the workaround
This output shows you the baseAddress and the requested URL:
which was the result of this code:
I can reproduce it now
Fixed in master and mono 4.0
I can confirm it's fixed on master. Thanks for the fast turn around.