Skip to content
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

Documentation incorrectly states one can construct a request body from File #1149

Closed
justinas opened this issue Jan 20, 2021 · 1 comment
Closed

Comments

@justinas
Copy link

reqwest/src/lib.rs

Lines 52 to 56 in bd9ff9f

//! There are several ways you can set the body of a request. The basic one is
//! by using the `body()` method of a [`RequestBuilder`][builder]. This lets you set the
//! exact raw bytes of what the body should be. It accepts various types,
//! including `String`, `Vec<u8>`, and `File`. If you wish to pass a custom
//! type, you can use the `reqwest::Body` constructors.

As per a recent Stack Overflow question. The linked docstring seems to indicate that body() accepts a File object. However, this is only true for blocking::Body, which supports the std File structure, meanwhile the async client seems to lack such implementation.

@justinas
Copy link
Author

Seems to have been fixed by #1360, #1456.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant