Use 307 instead of 302.
Changed request structure and added tests.