3
votes

In my xamarin application I need to implement the web-service using HttpClient.

So I create the test project & test the web-service - No problem here.

My code:

public async Task<string> registrationRequest()
    {
        HttpClient client = new HttpClient();
        string response = await client.GetStringAsync(registrationURL);

        return response;
    }

My problem:

After test the testing application I use the same code in my live project system.net.http not found error.

HttpClient - not resolved.

In my test project I am not install any Nuget packages.

I just use the

using System.Net.Http;

But in my live project this import return error.

Anyone help me out..

1

1 Answers

10
votes

You need to install the Microsoft.Net.Http nuget package in your PCL and platform-specific projects.