-3

I am using PATCH for one of my REST api. PATCH expects an existing entry for which the request is being made. How to handle the scenario if the data for which the request is being made does not exist?

I think an exception should be thrown if not existing data found. Since it's a PATCH request existing data is mandatory. can you suggest which exception should be thrown or any other idea?

RoyalTiger
  • 511
  • 2
  • 8
  • 27

1 Answers1

2

This article specifies that a 404 (Resource Not Found) would be the appropriate response code.

Matt Berteaux
  • 763
  • 4
  • 12