[wp-trac] [WordPress Trac] #42781: HTTP Status code should be a 400 instead of a 409 when attempting to add a term (by slug) that already exist

WordPress Trac noreply at wordpress.org
Thu Oct 18 20:32:01 UTC 2018


#42781: HTTP Status code should be a 400 instead of a 409 when attempting to add a
term (by slug) that already exist
--------------------------------------+--------------------------
 Reporter:  shooper                   |       Owner:  rachelbaker
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  5.0
Component:  REST API                  |     Version:  4.9
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:  rest-api
--------------------------------------+--------------------------
Changes (by danielbachhuber):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"43756" 43756]:
 {{{
 #!CommitTicketReference repository="" revision="43756"
 REST API: Correct HTTP status code in error for requests to create a
 duplicate term.

 The 409 error code is intended for situations where it is expected that
 the user will resolve the conflict and resubmit the same request. We use
 400 error codes for other routes when a duplicate request is made. The 400
 status code tells the user they need to modify their request for it to be
 successful.

 Props shooper.
 Merges [42354] to the 5.0 branch.
 Fixes #42781. See #41370.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/42781#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list