I am very new to mobile dev, so please forgive my basic question.
I have developed an API and would now like to use Xamarin.Forms to consume that API.
I'm using Refit because it simplyfies calling each endpoint by simply creating an interface.
I've created a new Xamarin.Forms project in VisualStudio and have added a registration form. I've also added the refit nuget package to my PCL and to the iOS, Android and WP8. From my iOS and WP8 projects I've added a reference to System.Net.Http
When I run my app on WP8, the app loads and when I make the request, I get:
Could not load file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral
My iOS project, does also load, but when I submit my form, I do hit my breakpoint where I call my API, but after I step over it never returns.
button.Clicked += async (sender, e) =>
{
var kbApi = RestService.For<IAuthenticationApi>("https://my-endpoint.com");
var registerForm = new UserRegistrationForm
{
FirstName = "Xamarin",
LastName = "Forms",
Email = "a@a.com",
Password = "pass"
};
var registration = await kbApi.Register(registerForm);
label.Text = registration.Id.ToString();
};
I've tried using Fiddler to intercept my traffic, but I don't show any requests from on either WP or iOS.
Do I need to be including System.Net.Http to use Refit or am I suppose to use ModernHttpClient?
Should I use a different library to consume my API?