From f4ded08c4cd6f70c1571828b18ba9aa05801b2b4 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Sat, 14 Mar 2026 09:43:54 +0100 Subject: [PATCH] feat: add output of response body and headers to files --- .gitignore | 8 ++++---- curl.sh | 45 +++++++++++++++++++++++++++++---------------- curl/.gitkeep | 0 init.sh | 11 +++++++++++ 4 files changed, 44 insertions(+), 20 deletions(-) create mode 100644 curl/.gitkeep create mode 100755 init.sh diff --git a/.gitignore b/.gitignore index 252e539..37211d2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -params.txt -headers.json -payload.json -disable_peer_validation \ No newline at end of file +curl/* +!curl/.gitkeep + +disable_peer_validation diff --git a/curl.sh b/curl.sh index db614c0..1819938 100755 --- a/curl.sh +++ b/curl.sh @@ -8,18 +8,25 @@ fi URL="$1" METHOD="$2" -PARAMS_FILE="params.txt" -HEADERS_FILE="headers.json" -PAYLOAD_FILE="payload.json" + DISABLE_SSL_FILE="disable_peer_validation" -# Append URL search parameters from params.txt -if [ -f $PARAMS_FILE ]; then - PARAMS=$( $RESP_BODY_JSON_FILE diff --git a/curl/.gitkeep b/curl/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/init.sh b/init.sh new file mode 100755 index 0000000..758e473 --- /dev/null +++ b/init.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +cd curl + +echo "" > resp_body.txt +echo "" > req_params.txt +echo "" > resp_headers.txt + +echo "{}" > req_body.json +echo "{}" > resp_body.json +echo "{}" > req_headers.json