Xamarin UWP HttpRequestException when using non-localhost (PCL)

I'm building an application with Xamarin.Forms and a Portable Class Library.
I try to do an API call which returns JSON. I have problems when running the project on Universal Windows Platform.
This is the code that throws an error:

Exception thrown: 'System.Net.Http.HttpRequestException' in mscorlib.ni.dll
at System.Net.Http.HttpClientHandler.d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Somethoing.RESTConnection.d__4.MoveNext()

The code does work on Android, but not in Universal Windows Platform. Why is the above code (without localhost) not working on UWP?

I only changed from localhost to an other URL. The only requirement to have access to the non-localhost URL (in my particular case) is that you are connected to the right network (same as where the website is hosted).