Fixed curl header variable initialisation.
Change header value iterator to pre-increment instead of post for performance/stability reasons.
Removed trailing spaces.