check_curl: add method back in
This commit is contained in:
parent
df49e77703
commit
6ac2c4b9c1
|
@ -12,6 +12,7 @@ usage() {
|
|||
-H Specify headers. Formatted like \"Header1: value,Header2: value\"
|
||||
-p Print the curl command and exit
|
||||
-R Set curl --resolve option.
|
||||
-M Set the HTTP mode (default: GET)
|
||||
-s Ignore the response status code."
|
||||
exit 3
|
||||
}
|
||||
|
@ -26,9 +27,10 @@ PRINT_CURL=""
|
|||
RESOLVE=""
|
||||
IGNORE_STATUS=""
|
||||
TIMEOUT=""
|
||||
HTTP_METHOD="-X GET"
|
||||
|
||||
# Parse arguments
|
||||
while getopts "u:w:c:C:LH:IpR:st:h" opt; do
|
||||
while getopts "u:w:c:C:LH:M:IpR:st:h" opt; do
|
||||
case $opt in
|
||||
u)
|
||||
URL="$OPTARG"
|
||||
|
@ -63,6 +65,9 @@ while getopts "u:w:c:C:LH:IpR:st:h" opt; do
|
|||
t)
|
||||
TIMEOUT="--max-time $OPTARG"
|
||||
;;
|
||||
M)
|
||||
HTTP_METHOD="-X $OPTARG"
|
||||
;;
|
||||
h)
|
||||
usage
|
||||
;;
|
||||
|
@ -81,7 +86,7 @@ if [ -z "$URL" ]; then
|
|||
fi
|
||||
|
||||
# Prepare curl command
|
||||
CURL_CMD="curl -w %{http_code};%{time_total} -o /dev/null -s $FOLLOW_REDIRECTS $INSECURE $HEADERS $RESOLVE $TIMEOUT $URL"
|
||||
CURL_CMD="curl -w %{http_code};%{time_total} -o /dev/null -s $HTTP_METHOD $FOLLOW_REDIRECTS $INSECURE $HEADERS $RESOLVE $TIMEOUT $URL"
|
||||
|
||||
# Print curl command if requested
|
||||
if [ "$PRINT_CURL" = "yes" ]; then
|
||||
|
|
Loading…
Reference in New Issue