Skip to content

Refit 1.3.0

Compare
Choose a tag to compare
@anaisbetts anaisbetts released this 25 Jul 07:49

What's New

Allow paths in the HttpClient base URL so you don't have to repeat yourself (#40, thanks @Balauru!)

    public interface IDummyHttpApi
    {
        [Get("/bar/{id}")]
        Task<string> FetchSomeStuff(int id);

        [Get("/bar/{id}?baz=bamf")]
        Task<string> FetchSomeStuffWithHardcodedQueryParameter(int id);
    }

    RestService.For<IDummyHttpApi>("http://api.com/foo")

Allow more than one parameter in a given URL segment (#47, thanks @bennor!)

    public interface IDummyHttpApi
    {
        [Get("/bar/{image}/{width}x{height}")]
        Task<byte[]> GetImageData(string image, int width, int height);
    }

Allow posting URL-encoded form data in the body (#46, thanks @bennor)

    public interface IDummyHttpApi
    {
        [Post("/foo/bar/{id}")]
        IObservable<string> PostSomeUrlEncodedStuff([AliasAs("id")] int anId, [Body(BodySerializationMethod.UrlEncoded)] Dictionary<string, string> theData);
    }

Bug fixes

  • Fixes "Misused header name" bug when using dynamic headers (#44, thanks @bennor)
  • Add more information about errors if we've got them (#45, thanks @bennor!)
  • Fixes problems related to IObservable replaying results correctly