Invoking the Refit code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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