Posts linux poll endpoint

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
$ while true; do wget -S -O /dev/null -q; echo "running"; sleep 1; done
  • Poll an endpoint using curl

you can filter header

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

you can even request server to send headers only

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

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