-
Notifications
You must be signed in to change notification settings - Fork 312
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
Examples of uploading and downloading files with os-lib support. #2399
Conversation
examples/src/main/scala/sttp/client4/examples/DowloadFileWitOsLib.scala
Outdated
Show resolved
Hide resolved
@main def uploadFileWithOsLib(): Unit = { | ||
val request = basicRequest | ||
.post(uri"http://httpbin.org/post") | ||
.body(os.read.inputStream(path)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, looks easy enough :)
can we add an example of uploading the result of a execute command-line command? (even if it's a simple cat ...
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should not be problem.
examples/src/main/scala/sttp/client4/examples/UploadFileWithOsLib.scala
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,20 @@ | |||
// {cat=Other; effects=Direct; backend=HttpClient}: Download file | |||
|
|||
//> using dep com.lihaoyi::os-lib:0.11.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it also needs sttp ;) did you try running those locally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I didn't push all changes to Github , now should be good.
BTW all examples I tested locally using sbt and scala-cli.
… streaming with os-lib support.
… streaming with os-lib support.
… streaming with os-lib support.
Before submitting pull request:
sbt compile
sbt compileDocs
sbt test
sbt scalafmt