mirror of
https://codeberg.org/vlw/curl.git
synced 2026-04-13 10:49:39 +02:00
Compare commits
No commits in common. "master" and "2.1.3" have entirely different histories.
1 changed files with 4 additions and 5 deletions
9
curl.sh
9
curl.sh
|
|
@ -23,10 +23,7 @@ method="${2:-GET}"
|
||||||
if [ -f $REQ_PARAMS_FILE ]; then
|
if [ -f $REQ_PARAMS_FILE ]; then
|
||||||
# Parse each newline as a separate parameter joined by a "&"
|
# Parse each newline as a separate parameter joined by a "&"
|
||||||
params=$(tr '\n' '&' < "$REQ_PARAMS_FILE" | sed 's/&$//')
|
params=$(tr '\n' '&' < "$REQ_PARAMS_FILE" | sed 's/&$//')
|
||||||
|
url="${url}?${params}"
|
||||||
if [ -n "$params" ]; then
|
|
||||||
url="${url}?${params}"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Prepare curl
|
# Prepare curl
|
||||||
|
|
@ -66,7 +63,9 @@ fi
|
||||||
# Save the response headers and body
|
# Save the response headers and body
|
||||||
curl_cmd="$curl_cmd -o $RESP_BODY_RAW_FILE -D $RESP_HEADERS_FILE"
|
curl_cmd="$curl_cmd -o $RESP_BODY_RAW_FILE -D $RESP_HEADERS_FILE"
|
||||||
|
|
||||||
# Dispatch request
|
# Execute curl
|
||||||
|
eval "clear"
|
||||||
|
|
||||||
echo -e "\e[0;92mRequest >\e[0m ${method} ${url}"
|
echo -e "\e[0;92mRequest >\e[0m ${method} ${url}"
|
||||||
eval $curl_cmd
|
eval $curl_cmd
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue