-
-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for multipart/form-data requests (including files) #113
Comments
This feature is now available in the latest prerelease: |
Hi @tmenier , fantastic! Can you post an example about preparing the |
var content = new CapturedMultipartContent()
.Add......
await new FlurlClient(url).SendAsync(HttpMethod.Post, content);
// or
await "http://api.com".WithClient(fc).SendAsync(HttpMethod.Post, content); |
@ecentinela The sample above made me realize there ought to be extension methods on string and Url to match FlurlClient's So, in the previous example, you can now build await "http://api.com".PostAsync(content); I did a beta9 for this if you want to test it, but I won't delay the full 1.0 release much longer. |
@tmenier I'm trying to upload a file with some body. Is On my C# code I have this:
FormBind reads data from the request and fills the object. By using
This is my current try:
|
mulipart/form-data requests will be supported in Flurl.Http 1.0 via the following syntax:
In the above example,
mp
is aCapturedMultiplartContent
, which can be built fluently inline as shown, or separately. It contains a read-onlyParts
array ofHttpContent
objects that have been added, which can later be inspected.The text was updated successfully, but these errors were encountered: