-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Feature request: Support for the file:// scheme? #178
Comments
I have wondered this myself. On one hand, there is At the same time, curl offers it, and people seem to like that. Is that a good thing? Or is it a mistake that curl just has to live with forever now? |
IMHO |
@clarcharr "all we need" for what? To implement this feature? Or do you mean the feature isn't needed because "all we need" is a |
Sorry, that was actually very vague. I meant that people wishing to support |
What does it mean to |
I think the answers to lots of these questions are probably best resolved by seeing what curl does, but also I'm not longer sure that this is particularly necessary, checking the scheme and using |
Huh, looks like
|
Personally I think since |
I think that should be done in the very least is: do not panic for extern crate reqwest;
fn main() {
let uri_str = "file:///etc/resolv.conf";
let mut _resp = reqwest::get(uri_str);
println!("Hello, world!");
} Will panic:
|
|
This feature would be extremely useful in my project. I want to use a "file://" url to load resources when the user is using the desktop version, and an "http://" when using Web Assembly. |
Yes, this feature would be would be super useful for tests. I won't be using file:// URL's in production, but it's super useful for tests. If my code under test does something different for file:// URL's, then using file:// URL's in tests doesn't test all of my code. OTOH, if the support is in reqwest it does... |
I'm unsure if reqwest is necessarily the right place to put this since I could probably easily implement it in a very small wrapper, but it would be nice to have support for reading files with the
file://
scheme so that I can use it for testing without firing up an HTTP server.If this is out of scope for reqwest, I completely understand.
The text was updated successfully, but these errors were encountered: