It's worth noting that the `header` array seems to only want an array of strings, not an associative array.
I just spent a chunk of time debugging something not working as expected (no errors though) which was fixed by converting an associative array of headers into a simple array of strings.