webhookinbox icon indicating copy to clipboard operation
webhookinbox copied to clipboard

POST is sent but GET is captured

Open natsu90 opened this issue 9 years ago • 2 comments

I sent POST http://api.webhookinbox.com/i/{id}/in (notice the missing last trailing slash), but view would show as GET request instead.

natsu90 avatar Nov 15 '15 04:11 natsu90

Ah, probably because Django returns a code 301 redirect, which means the client is supposed to use GET when following the redirect. We should consider using code 308 which preserves the request method across redirects.

jkarneges avatar Nov 15 '15 04:11 jkarneges

Looks like the way to do this is to subclass CommonMiddleware and override the response_redirect_class attribute.

jkarneges avatar Nov 15 '15 04:11 jkarneges