Posts linux poll endpoint
Post
Cancel

linux poll endpoint

  • Poll an endpoint

Using linux terminal we can poll an endpoint by using combination of while loop with wget or curl.

We cak ignore the output and print only header

  • Poll an endpoint using wget
1
$ while true; do wget -S -O /dev/null -q https://test_website.com; echo "running"; sleep 1; done
  • Poll an endpoint using curl

you can filter header

1
$ while true; do curl --insecure --write-out '%{http_code}' --silent --output /dev/null https://test_website.com; echo "running"; sleep 1; done

you can even request server to send headers only

curl –insecure HEAD -I –silent –output /dev/null

1
$ while true; do curl --insecure HEAD -I --silent --output /dev/null https://test_website.com; echo "running"; sleep 1; done
This post is licensed under CC BY 4.0 by the author.