Apply @johanneskoch's patch to make URL resolution work with POST too

Patch: https://gist.github.com/johanneskoch/ee1288f490f8a7640207
Apply @johanneskoch's patch.