2 Commits

2 changed files with 7 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ set -euo pipefail
API_URL="https://jmespath-playground.koszewscy.waw.pl" API_URL="https://jmespath-playground.koszewscy.waw.pl"
JSON_FILE="-" JSON_FILE="-"
ADD_HEADERS=()
function usage() { function usage() {
echo "Usage: $0 [--api-url <url>] [--json-file <file>]" echo "Usage: $0 [--api-url <url>] [--json-file <file>]"
@@ -16,6 +17,10 @@ while [[ $# -gt 0 ]]; do
API_URL="$2" API_URL="$2"
shift 2 shift 2
;; ;;
--api-key)
ADD_HEADERS+=("-H" "X-API-Key: $2")
shift 2
;;
--json-file) --json-file)
JSON_FILE="$2" JSON_FILE="$2"
shift 2 shift 2
@@ -36,6 +41,7 @@ done
curl -s -X POST \ curl -s -X POST \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-H "Accept: application/json" \ -H "Accept: application/json" \
"${ADD_HEADERS[@]}" \
--data @${JSON_FILE} \ --data @${JSON_FILE} \
"$API_URL/api/v1/upload" "$API_URL/api/v1/upload"

View File

@@ -1,6 +1,6 @@
{ {
"name": "jmespath-playground", "name": "jmespath-playground",
"version": "1.2.0", "version": "1.2.1",
"description": "A React-based web application for testing JMESPath expressions against JSON data", "description": "A React-based web application for testing JMESPath expressions against JSON data",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {