# General Functions

## HTTP Functions

| Function | Description |
| -------- | ----------- |
| [DELETE](DELETE.md) | Executes a HTTP DELETE request |
| [DOWNLOAD](DOWNLOAD.md) | Downloads a file with HTTP |
| [GET](GET.md) | Executes a HTTP GET request |
| [HEAD](HEAD.md) | Executes a HTTP HEAD request |
| [OPTIONS](OPTIONS.md) | Executes a HTTP OPTIONS request |
| [PATCH](PATCH.md) | Executes a HTTP PATCH request |
| [POST](POST.md) | Executes a HTTP POST request |
| [PUT](PUT.md) | Executes a HTTP PUT request |
| [restsh.download](restsh.download.md) | Download a file in chunks (default 512kB). |
| [restsh.http](restsh.http.md) | Generic http request function |
| [restsh.upload](restsh.upload.md) | Uploads a file in chunks (default 512kB). |

## Utility Functions

| Function | Description |
| -------- | ----------- |
| [COLUMN](COLUMN.md) | Replacement for the column command, separator is tab. |
| [JQ](JQ.md) | Shortcut to call jq. |
| [JQE](JQE.md) | Shortcut to call jq, exits with 1 on null or false. |
| [KV](KV.md) | Print Key/Value pairs |
| [MO](MO.md) | Shortcut to call the mustache template engine. |
| [XARGS](XARGS.md) | Shortcut for xargs, running the command sequentially and only with one parameter. |
| [echo_err](echo_err.md) | Prints red error messages to STDERR. |
| [echo_ok](echo_ok.md) | Prints green ok messages to STDOUT. |
| [echo_verbose](echo_verbose.md) | Prints message only if RESTSH_VERBOSE is set to 1. |
| [echo_warn](echo_warn.md) | Prints yellow warning messages to STDERR. |
| [print_json_err](print_json_err.md) | Prints red error message in JSON format to STDERR. |
| [print_json_err_curl](print_json_err_curl.md) | Prints red error message in JSON format to STDERR for curl. |
| [print_json_ok](print_json_ok.md) | Prints green ok message in JSON format to STDOUT. |
| [print_json_ok_curl](print_json_ok_curl.md) | Prints green ok message in JSON format to STDOUT for curl. |
| [print_json_warn](print_json_warn.md) | Prints yellow warning message in JSON format to STDOUT. |
| [print_json_warn_curl](print_json_warn_curl.md) | Prints yellow warning message in JSON format to STDOUT for curl. |
| [restsh.util.array.includes](restsh.util.array.includes.md) | Check if first argument is in array (following arguments) |
| [restsh.util.array.string](restsh.util.array.string.md) | Converts an array to a quoted string |
| [restsh.util.askpass](restsh.util.askpass.md) | Asks for a secret string. |
| [restsh.util.base64url](restsh.util.base64url.md) | Encodes string as Base64URL. |
| [restsh.util.check.bool](restsh.util.check.bool.md) | Returns 1 if value is not a boolean |
| [restsh.util.check.filename](restsh.util.check.filename.md) | Validates a value. |
| [restsh.util.check.isnumber](restsh.util.check.isnumber.md) | Returns 1 if value is not a number |
| [restsh.util.check.isvarname](restsh.util.check.isvarname.md) | Returns 1 if value is not a valid variable name |
| [restsh.util.check.notempty](restsh.util.check.notempty.md) | Returns 1 if value is undefined, length is zero, contains only whitespaces or is null |
| [restsh.util.check.string](restsh.util.check.string.md) | Validates a value. |
| [restsh.util.check.uint](restsh.util.check.uint.md) | Returns 1 if value is not an unsigned integer |
| [restsh.util.check.varnotempty](restsh.util.check.varnotempty.md) | Returns 1 if variable reference is undefined, length is zero, contains only whitespaces or is null |
| [restsh.util.declare.var](restsh.util.declare.var.md) | Declares a variable KEY=VALUE |
| [restsh.util.eval_stage_var](restsh.util.eval_stage_var.md) | Tries to resolve the staging variable. |
| [restsh.util.filesize](restsh.util.filesize.md) | Get file size |
| [restsh.util.isencrypted](restsh.util.isencrypted.md) | Checks for AES256: prefix of provided string. |
| [restsh.util.json_validate](restsh.util.json_validate.md) | JSON validation, pipe string to stdin |
| [restsh.util.jsonencode](restsh.util.jsonencode.md) | JSON encoding |
| [restsh.util.lc](restsh.util.lc.md) | Convert string to lower case. |
| [restsh.util.parseoutput](restsh.util.parseoutput.md) | Parses a command output. |
| [restsh.util.setcurloptions](restsh.util.setcurloptions.md) | Sets the RESTSH_CURL_OPTIONS environment variable. |
| [restsh.util.setvar](restsh.util.setvar.md) | Declares a variable from a file. .txt extension for simple variable, .array for array. |
| [restsh.util.setvars](restsh.util.setvars.md) | Declares variables from a directory. .txt extension for simple variables, .array for arrays. |
| [restsh.util.trim](restsh.util.trim.md) | Trim leading and trailing whitespaces. |
| [restsh.util.uc](restsh.util.uc.md) | Convert string to upper case. |
| [restsh.util.urlencode](restsh.util.urlencode.md) | URL encoding |
| [restsh.util.var.decrypt](restsh.util.var.decrypt.md) | Decrypts a variable or fetches it from HashiCorp Vault. |

## Restsh Functions

| Function | Description |
| -------- | ----------- |
| [restsh.check.http-header](restsh.check.http-header.md) | Checks HTTP headers against defined policy. |
| [restsh.passphrase](restsh.passphrase.md) | Generates a passphrase. |
| [restsh.pwgen](restsh.pwgen.md) | Generates a secure password. |
| [restsh.util.decrypt](restsh.util.decrypt.md) | AES256 decryption of string. |
| [restsh.util.encrypt](restsh.util.encrypt.md) | AES256 encryption of string. |

## Vault Functions

| Function | Description |
| -------- | ----------- |
| [vault.get](vault.get.md) | Get value from Vault |
| [vault.login](vault.login.md) | Detects the Vault login method and tries to fetch a Vault token. |
| [vault.login.jwt](vault.login.jwt.md) | Login into Vault with VAULT_ID_TOKEN |
| [vault.logout](vault.logout.md) | Logout from Vault |
