http-status-code-412

When is it appropriate to respond with a HTTP 412 error?

对着背影说爱祢 提交于 2019-12-17 16:24:44
问题 It is unclear to me when you should and should not return a HTTP 412: Precondition Failed, error for a web service? I am thinking of using it when validating data. For example, if a client POST's XML data and that data is missing a required data element, then responding with a 412 and a description of the error. Does that align with the spirit of responding with an HTTP 412, or should something else be used (e.g. another http error code or web application exception)? 回答1: If you look at RFC

CalDav Client for iCloud: MKCOL fails with 412 precondition failed

a 夏天 提交于 2019-12-11 02:47:50
问题 I need help. I implemented a CalDav Client on our System and it worked like a charm. Now I have some problems with creating new calendars on iCloud. Maybe some of you know how I can fix this. Currently I get a 412 Error. Headers: "Depth: 1" "Content-Type: application/xml; charset=UTF-8" "User-Agent: DAVKit/4.0.1 (730); CalendarStore/4.0.1 (973); iCal/4.0.1 (1374); Mac OS X/10.6.2 (10C540)"` Request: `MKCOL` Body: <D:mkcol xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav"> <D:set> <D:prop

HTTP Status 412 (Precondition Failed) and Database Versioning

我是研究僧i 提交于 2019-11-29 09:34:43
I am implementing a RESTful web service that accesses a database. Entities in the database are versioned to detect multiple updates. For instance, if the current value is {"name":"Bill", "comment":"tinker", "version":3} , if one user PUTs {"name":"Bill", "comment":"tailor", "version":3} , the request will succeed (200 OK) and the new value will be {"name":"Bill", "comment":"tailor", "version":4} . If a second user PUTs {"name":"Bill", "comment":"sailor", "version":3"} that request will fail (409 Conflict) because the version number does not match. There are existing non-RESTful interfaces, so

HTTP Status 412 (Precondition Failed) and Database Versioning

喜夏-厌秋 提交于 2019-11-28 03:02:01
问题 I am implementing a RESTful web service that accesses a database. Entities in the database are versioned to detect multiple updates. For instance, if the current value is {"name":"Bill", "comment":"tinker", "version":3} , if one user PUTs {"name":"Bill", "comment":"tailor", "version":3} , the request will succeed (200 OK) and the new value will be {"name":"Bill", "comment":"tailor", "version":4} . If a second user PUTs {"name":"Bill", "comment":"sailor", "version":3"} that request will fail

When is it appropriate to respond with a HTTP 412 error?

 ̄綄美尐妖づ 提交于 2019-11-27 22:41:20
It is unclear to me when you should and should not return a HTTP 412: Precondition Failed, error for a web service? I am thinking of using it when validating data. For example, if a client POST's XML data and that data is missing a required data element, then responding with a 412 and a description of the error. Does that align with the spirit of responding with an HTTP 412, or should something else be used (e.g. another http error code or web application exception)? If you look at RFC 2616 you'll see a number of request headers that can be used to apply conditions to a request: If-Match If