Skip to content

Instantly share code, notes, and snippets.

@jfversluis
Last active March 24, 2017 10:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfversluis/b4de1f3bc1117c86d3b14a7e8f012da3 to your computer and use it in GitHub Desktop.
Save jfversluis/b4de1f3bc1117c86d3b14a7e8f012da3 to your computer and use it in GitHub Desktop.
Invoking the Refit code
using Refit;
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace RefitTestApp
{
public class RestClient
{
private readonly IRestClient _restClient;
public RestClient ()
{
_restClient = RestService.For<IRestClient> ("https://jsonplaceholder.typicode.com");
}
public async Task<Foo []> GetPosts ()
{
return await _restClient.GetPosts ();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment