mirror of
https://github.com/nushell/nushell
synced 2024-12-26 21:13:19 +00:00
Add useful example to http options
documentation (#9576)
This PR adds a more real-world example of how the new http options is used, as well as some additional information in the description.
This commit is contained in:
parent
88b22a9248
commit
9547c106d3
1 changed files with 6 additions and 1 deletions
|
@ -72,7 +72,7 @@ impl Command for SubCommand {
|
|||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
"Performs HTTP OPTIONS operation."
|
||||
"Performs an HTTP OPTIONS request. Most commonly used for making CORS preflight requests."
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
|
@ -111,6 +111,11 @@ impl Command for SubCommand {
|
|||
example: "http options -H [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com",
|
||||
result: None,
|
||||
},
|
||||
Example {
|
||||
description: "Simulate a browser cross-origin preflight request from www.example.com to media.example.com",
|
||||
example: "http options https://media.example.com/api/ -H [Origin https://www.example.com Access-Control-Request-Headers \"Content-Type, X-Custom-Header\" Access-Control-Request-Method GET]",
|
||||
result: None,
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue