7

I'm implementing a REST Api using basic Servlets in Java and I can't seem to find a doPatch() method.

Why does HttpServlet not implement a PATCH method? I'd like to use it 'cause it is more meaningful for resources update.

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
LppEdd
  • 20,274
  • 11
  • 84
  • 139
  • 4
    this should shed some light on the decision https://stackoverflow.com/questions/24257327/http-patch-support-in-browsers – Ramanlfc Nov 02 '17 at 17:01
  • JSR 315 that defines servlet api 3.0 does not recognize patch method. so its not implemented. – awd Nov 02 '17 at 17:05
  • @Ramanlfc will using a PUT instead be equally correct? – LppEdd Nov 02 '17 at 18:53
  • 1
    PUT should be used for completely replace a resource. PATCH for modifying just some of its properties. – bluish Mar 26 '19 at 09:25
  • @bluish in the end I resorted to POST, at that time. Note that I don't use the Servlet stack anymore when possible. – LppEdd Mar 26 '19 at 09:26

0 Answers0