asp.net web api - Can't call Web api from Xamarin -


i'm trying make simple web api call using httpclient in ios build. when setting client.baseaddress, baseaddress ends null. can't find possibly wrong.

    using system.net.http;      ....     private const string baseapiurl = "http://localhost:55904/";     static httpclient client = new httpclient();     client.baseaddress = new uri(baseapiurl);     // client.baseaddress still null 

i downloaded sample non-xamarin project , same code works fine. ideas?

update continue messing figured try of other platforms. uwp seems work fine. going test android of sudden, have bunch of "the name 'initializecomponent' not exist in current context" errors. i'm new xamarin not vs or c#.

update thinking, ios need request special permission internet access? if so, set?

just in case else comes across problem, found cause. turns out ios project didn't include reference system.net.http. once added reference, worked fine.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -