tmenier / Flurl

Fluent URL builder and testable HTTP client for .NET
https://flurl.dev
MIT License
4.23k stars 387 forks source link

Add PatchMultipartAsync #840

Closed 1zaboy closed 2 months ago

1zaboy commented 2 months ago

I faced with the need to make PatchMultipartAsync with external API. I not found solution in Flurl and I had to make an extension. Why not add this functionality? Can I contribute this?

tmenier commented 2 months ago

Thanks for the offer. I'm sure you discovered that PostMultiplartAsync is just a 3-line extension method that can be easily replicated with a different verb:

https://github.com/tmenier/Flurl/blob/da6121b671ae1c71e0328882095621c2049599ed/src/Flurl.Http/MultipartExtensions.cs#L22-L26

I'm declining to add this to the core, both because it's easy enough to do yourself as demonstrated above, and because it's so rare to encounter anything other than POST used with multipart. It's a judgment call, but Flurl's highest-level methods are generally reserved for the more common scenarios, while dropping down a level to SendAsync lets you cover the less common ones, almost as easily.