Skip to content

Bash REST

Kam Lagan edited this page Nov 2, 2021 · 1 revision

Getting started

# create a file with a template
cat<<EOF >> curlfile
\n
                  http_code:  %{http_code}\n
            time_namelookup:  %{time_namelookup}\n
               time_connect:  %{time_connect}\n
            time_appconnect:  %{time_appconnect}\n
           time_pretransfer:  %{time_pretransfer}\n
              time_redirect:  %{time_redirect}\n
         time_starttransfer:  %{time_starttransfer}\n
                            ----------\n
                 time_total:  %{time_total}\n
\n
EOF

# run a recursive statement to call an endpoint every 3 seconds and print he results using the template file above
while sleep 3;do curl -s -w "@curlfile" -o /dev/null https://appsvc-test-win.azurewebsites.net/; done

Clone this wiki locally