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

Downloading a file #30

Open
szymon-rd opened this issue Sep 11, 2023 · 1 comment
Open

Downloading a file #30

szymon-rd opened this issue Sep 11, 2023 · 1 comment

Comments

@szymon-rd
Copy link
Contributor

Make sure that there is a good DX when downloading a file + add a tutorial on that.

@lihaoyi
Copy link

lihaoyi commented Oct 30, 2023

FWIW this is a one-liner using os-lib and requests-scala, including (lack of) imports, streaming the file contents directly to disk

$ amm
Loading...
Welcome to the Ammonite Repl 2.5.4 (Scala 2.13.8 Java 17.0.6)
@ os.write(os.pwd / "file.html", requests.get.stream("https://www.lihaoyi.com/")) 

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

2 participants