-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
FR: Support Data URIs #122
Comments
If you're ok to special-case this kind of URL for the time being, you can use
|
Does libcurl support this? |
I don't really want to start hacking Downloads to support additional URI schemas in addition to what libcurl support in an ad hoc way, so the way to make forward progress on this is to make a feature request to libcurl to add support for this and then Downloads would inherit that support automatically. |
I implemented a wrapper around |
(I'm too intimidated by libcurl's mailing list to submit the feature request myself) |
Eh, maybe we can just special case this. I'll reopen for consideration. |
@StefanKarpinski Should I start a PR? |
Sure. I would handle it in the body of the |
Any previous art in other languages with a download function? |
|
About the request methods, it looks like > const url = "data:;base64,aGVsbG8="
undefined
> await (await fetch(url, {method: "GET"})).text()
"hello"
> await (await fetch(url, {method: "HEAD"})).text()
""
> await (await fetch(url, {method: "PUT"})).text()
"hello"
> await (await fetch(url, {method: "POST"})).text()
"hello"
> await (await fetch(url, {method: "POST", body: "world"})).text()
"hello" (open a new tab and press F12 to run this code) Looking at the spec, it looks like nothing is returned for |
Increasingly common in webworld is the use of Data URIs, which contain the data in the URL itself.
For example (from wikipedia), this URL points to an image of a red dot (copy and open it in a new tab):
Currently, the
data:
protocol is not supported in Downloads.jl, nor the old built-indownload
, but it would be great to have it added!The text was updated successfully, but these errors were encountered: