Skip to content

Commit

Permalink
Implementation of reported remarks.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwkaczmarek committed Jan 14, 2025
1 parent 9c2e87d commit 7922a53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import sttp.client4.*
import os.*

private val fileSize = 8192
private val dest: os.Path =
os.pwd / "examples" / "src" / "main" / "resources" / s"file-example-$fileSize-bytes"
private val dest: os.Path = os.Path(s"/tmp/file-example-$fileSize-bytes")
private val backend: SyncBackend = DefaultSyncBackend()

@main def downloadFileWithOsLib(): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ package sttp.client4.examples
import sttp.client4.*
import os.*

private val path: os.Path =
os.pwd / "examples" / "src" / "main" / "resources" / "some-text-file.txt"
private val path: os.Path = os.Path("/tmp/example-file.txt")
private val backend: SyncBackend = DefaultSyncBackend()

@main def uploadFileWithOsLib(): Unit = {
os.remove(path)
os.write(path, "THIS IS CONTENT OF TEST FILE")
val request = basicRequest
.post(uri"http://httpbin.org/post")
.body(os.read.inputStream(path))
Expand Down

0 comments on commit 7922a53

Please sign in to comment.