When hitting /api/1/job/[id] with http DELETE, it causes a
redirect to /job/apiDeleteJob/[id], but this is a problem without
adding redirect logic in modules like Python's urllib2, or adding a
handler to support it. Other tools, like Poster's API/REST
emulator, do not pass DELETE along with the redirect, so a 405 is
returned.
From the IRC:
[11:10] <ameier> Hi all, I'm trying to delete a job via the API, but sending http DELETE to /api/1/job/[id] is failing with 405 Method Not Allowed... any suggestions? This occurs with using Python's urllib2, or through the Poster module in Firefox. Authentication is working, and job creation works (as long as the content type is multipart/form).
...
[12:02] <gschueler> however if i try with the Poster extension, it fails with 405. i think it may not use DELETE when following the 302 redirect
[12:03] <ameier> Ah, so the trick is to follow the redirect
[12:03] <ameier> ?
[12:03] <gschueler> try bypassing the /api request and use /job/apiJobDelete/3
[12:04] <gschueler> (your job id instead of 3)
[12:04] <gschueler> if that works i think the redirect is the issue here
[12:04] <ameier> got it, thanks for your help, will update in a few
[12:05] <gschueler> nb: testing with Poster that seems to work ok for me
[12:09] <ameier> Yup, both Python and Poster don't follow the redirects, and when I was using the test-job-delete.sh script, I think there was a cookie issue on my end. Thank you very much for your help!
[12:09] <Alex-SF> cool. thanks for that gschueler
[12:10] <gschueler> sure, no problem
[12:10] <gschueler> ameier: so did you fix it by using that secondary URL, or by enabling redirects?
[12:11] <gschueler> btw please file this as a bug, i can change the /api url usage so that it doesn't have to perform a redirect