How to get the value of a response header

Trying to pull all orders “awaiting shipment” but I’m only getting the most recent 10 orders. I’ve read on this forum that you can page through the results to get them all and that there is a response header, X-Total-Pages-Count, which is the total number of pages. What is the syntax to pull that value into a variable so I could run through i=1 through X-Total-Pages-Count?