Pass redirection as callback

Passing redirection as a callback function prevents it to be called before POST request has been issued. Otherwise, on slow networks, redirection is effective before POST request and it leads to an internal server error at best or really strange behaviour at worst.
Merge pull request #15 from Erwyn/patch-1

Pass redirection as callback