Skip to content

Refit 2.3.0

Compare
Choose a tag to compare
@anaisbetts anaisbetts released this 01 Jun 04:58
· 1533 commits to main since this release

What's New

Multipart uploads (#146, thanks @mteper)

Methods decorated with Multipart attribute will be submitted with multipart content type.
At this time, multipart methods support the following parameter types:

  • string (parameter name will be used as name and string value as value)
  • byte array
  • Stream
  • FileInfo

For byte array and Stream parameters, use AttachmentName parameter attribute to specify the
name for the attachment. For FileInfo parameters, the file name will be used.

public interface ISomeApi
{
    [Multipart]
    [Post("/users/{id}/photo")]
    Task UploadPhoto(int id, [AttachmentName("photo.jpg")] Stream stream);
}

New Features

  • HttpContent can now be returned or used as a parameter, and it will be used as the body (#104, thanks @onovotny)

Bug Fixes

  • Fix bugs around content headers (#139, thanks @bennor)