Fix binary example and add one for text uploads (#14307)

# Description

In #14291, I misunderstood the use-case for `into binary` with `http
post`. Thanks again to @weirdan for steering me straight on that. This
reverts the example that I changed and adds a new one for uploading text
files.

# User-Facing Changes

Doc-only

# Tests + Formatting

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`

# After Submitting

N/A
This commit is contained in:
Douglas 2024-11-11 13:49:49 -05:00 committed by GitHub
parent 07ad24ab97
commit a541382776
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -128,8 +128,13 @@ impl Command for SubCommand {
result: None,
},
Example {
description: "Upload a file to example.com",
example: "http post --content-type multipart/form-data https://www.example.com { file: (open -r file.mp3 | into binary) }",
description: "Upload a binary file to example.com",
example: "http post --content-type multipart/form-data https://www.example.com { file: (open -r file.mp3) }",
result: None,
},
Example {
description: "Convert a text file into binary and upload it to example.com",
example: "http post --content-type multipart/form-data https://www.example.com { file: (open -r file.txt | into binary) }",
result: None,
},
]