Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion ttfb
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,16 @@ DEBUG=""
LOG=""
NUM_REQUESTS=0
VERBOSE=0
JSON_BODY=""

while getopts ":n:dl:v" OPTION
while getopts ":n:dl:vj:" OPTION
do
case $OPTION in
d) DEBUG=1 ;;
l) LOG="$OPTARG" ;;
n) NUM_REQUESTS=$OPTARG ;;
v) VERBOSE=1 ;;
j) JSON_BODY="$OPTARG" ;;
\?) show_usage
exit 1
;;
Expand Down Expand Up @@ -154,6 +156,11 @@ if [ $DEBUG -eq 1 ]; then
options+=(-D "${LOG_DIRECTORY}/${LOG}")
fi

if [ ! -z "${JSON_BODY}" ]; then
options+=(-H 'Content-Type: application/json')
options+=(-d "${JSON_BODY}")
fi

for URL in $URLS; do

# if we're checking more than one url
Expand Down