From 906bd705401a933527ba9760edc0034c09d3d7e6 Mon Sep 17 00:00:00 2001 From: ducaale Date: Sun, 9 Oct 2022 00:33:30 +0100 Subject: [PATCH] update docs --- README.md | 3 ++- src/cli.rs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5da29e77..704dd82b 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,8 @@ Run `xh help` for more detailed information. - `@` for including files in multipart requests e.g `picture@hello.jpg` or `picture@hello.jpg;type=image/jpeg;filename=goodbye.jpg`. - `:` for adding or removing headers e.g `connection:keep-alive` or `connection:`. - `;` for including headers with empty values e.g `header-without-value;`. -- `=@`/`:=@` for setting the request body's JSON or form fields from a file (`=@` for strings and `:=@` for other JSON types). + +`@` postfix can be added to `=`,`:=`,`==` and `:` to read the value from a file e.g `x-api-key:@api-key.txt`. The request body can also be read from standard input, or from a file using `@filename`. diff --git a/src/cli.rs b/src/cli.rs index 6e85148c..49c08491 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -310,6 +310,8 @@ pub struct Cli { /// - header: to unset a header /// - header; to add a header with an empty value /// + /// `@` postfix can be added to `=`,`:=`,`==` and `:` to read the value from a file e.g. `x-api-key:@api-key.txt`. + /// /// A backslash can be used to escape special characters (e.g. weird\:key=value). #[clap(value_name = "REQUEST_ITEM", verbatim_doc_comment)] raw_rest_args: Vec,