Skip to content

Commit 1961997

Browse files
Jon Brisbinjbrisbin
authored andcommitted
Update the README to reflect new commands.
1 parent e3a5102 commit 1961997

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,37 @@ Since the rest-shell is aware of environment variables and system properties, yo
185185
... resources for this URL
186186
http://mylongdomain.com/api:>
187187

188+
### Per-user shell initialization
189+
190+
The rest-shell supports a "dotrc" type of initialization by reading in all files found in the `$HOME/.rest-shell/` directory and assuming they have shell commands in them. The rest-shell will execute these commands on startup. This makes it easy to set variables for commonly-used URIs or possibly set a `baseUri`.
191+
192+
echo "var set --name svcuri --value http://api.myservice.com/v1" > ~/.rest-shell/00-vars
193+
echo "discover #{svcuri}" > ~/.rest-shell/01-baseUri
194+
195+
> rest-shell
196+
197+
INFO: No resources found...
198+
INFO: Base URI set to 'http://api.myservice.com/v1'
199+
200+
___ ___ __ _____ __ _ _ _ _ __
201+
| _ \ __/' _/_ _/' _/| || | / / | \ \
202+
| v / _|`._`. | | `._`.| >< | / / / > >
203+
|_|_\___|___/ |_| |___/|_||_| |_/_/ /_/
204+
1.1.5.BUILD-SNAPSHOT
205+
206+
Welcome to the REST shell. For assistance hit TAB or type "help".
207+
http://api.myservice.com/v1:>
208+
209+
### SSL Certificate Validation
210+
211+
If you generate a self-signed certificate for your server, by default the rest-shell will complain and refuse to connect. This is the default behavior of RestTemplate. To turn off certificate and hostname checking, use the `ssl validate --enabled false` command.
212+
213+
### HTTP Basic authentication
214+
215+
There is also a convenience command for setting an HTTP Basic authentication header. Use `auth basic --username user --pasword passwd` to set a username and password to base64 encode and place into the Authorization header that will be part of the current session's headers.
216+
217+
You can clear the authentication by using the `auth clear` command or by removing the Authorization header using the `headers clear` command.
218+
188219
### Commands
189220

190221
The rest-shell provides the following commands:
@@ -207,4 +238,5 @@ The rest-shell provides the following commands:
207238
* `put` - HTTP PUT to the given path, passing JSON given in the `--data` parameter.
208239
* `delete` - HTTP DELETE to the given path.
209240
* `auth basic` - Set an HTTP Basic authentication token for use in this session.
210-
* `ssl validate` - Disable certificate checking to work with self-signed certificates.
241+
* `auth clear` - Clear the Authorization header currently in use.
242+
* `ssl validate` - Disable certificate checking to work with self-signed certificates.

0 commit comments

Comments
 (0)