zimg icon indicating copy to clipboard operation
zimg copied to clipboard

Use HTTP DELETE to delete an image

Open niko opened this issue 8 years ago • 1 comments

As far as I've seen images are deleted by a GET-Request to /admin?md5=12345&t=1.

Best practice IMHO would be to

  • Never be destructive on GET requests.
  • Use DELETE requests for deletes.
  • Use POST requests with a parameter action=delete to trigger a delete from a webbrowser form.

I would suggest to:

  • Introduce DELETE A.S.A.P to delete images.
  • Depricate deletion by GET request.
  • Remove deletion by GET requests in version 4.0.

niko avatar Jan 26 '17 14:01 niko

Yes, it is a bad for deleting images through GET method. All the api will be refactored and under RESTful style in the next version~

buaazp avatar Jan 31 '17 13:01 buaazp