Hello SurferTim:
Yes, the code as presented works. The problem is that after a while of constant disconnect/reconnects, its like the client gets tired and halts.
The function and the initial code provided work as advertised, except when it comes to leaving the Arduino alone for a while. From the moment I hit RESET, the board gets an IP, blinks the "OK" blink, then goes into the correct mode (lock/scan or unlock). If it's in lock/scan mode, I can scan a card and it'll read it, report to the API and act on the API's response as expected. If it's in unlock mode, it'll poll the API as expected.
The issue is that after a minute or so of sitting "idle" (not actively working on a received card) the polling will arbitrarily stop. When it does, the card reader doesn't see a new card and I stop seeing the polls go out.