Loading ...
Sorry, an error occurred while loading the content.
 

Making ETags mandatory

Expand Messages
  • julianbreich
    Hi, while working on our new RESTful web service and discovering the need for versioning (mainly preventing concurrent changes) I wondered whether it was
    Message 1 of 6 , Aug 27, 2009
      Hi,

      while working on our new RESTful web service and discovering the need for versioning (mainly preventing concurrent changes) I wondered whether it was acceptable to make ETags (i.e. presence of an If-Match header for PUT, DELETE and maybe POST where applicable) mandatory.
      In RFC 2616 I could not find any evidence that this allowed or forbidden. But I might have overlooked it.
      If you consider it acceptable: which status code would you return to a client that did not provide an appropriate header? Well certainly one of the 4xx errors, but I'm not sure which to choose in particular.


      Regards,
      Julian Reich
    • Jan Algermissen
      Julian, ... Incidently I asked the same thing a while ago and it has been suggested to use 412 Precondition Failed + explanatory text. Sounded like the best
      Message 2 of 6 , Aug 27, 2009
        Julian,

        On Aug 27, 2009, at 11:19 AM, julianbreich wrote:

        > Hi,
        >
        > while working on our new RESTful web service and discovering the
        > need for versioning (mainly preventing concurrent changes) I
        > wondered whether it was acceptable to make ETags (i.e. presence of
        > an If-Match header for PUT, DELETE and maybe POST where applicable)
        > mandatory.
        > In RFC 2616 I could not find any evidence that this allowed or
        > forbidden. But I might have overlooked it.
        > If you consider it acceptable: which status code would you return to
        > a client that did not provide an appropriate header? Well certainly
        > one of the 4xx errors, but I'm not sure which to choose in particular.

        Incidently I asked the same thing a while ago and it has been
        suggested to use 412 Precondition Failed + explanatory text.

        Sounded like the best idea.

        Jan



        >
        >
        > Regards,
        > Julian Reich
        >
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
      • Julian Reschke
        ... Nope (I think): The precondition given in one or more of the request-header fields evaluated to false when it was tested on the server. This response code
        Message 3 of 6 , Aug 28, 2009
          Jan Algermissen wrote:
          > On Aug 27, 2009, at 11:19 AM, julianbreich wrote:
          >
          > > Hi,
          > >
          > > while working on our new RESTful web service and discovering the
          > > need for versioning (mainly preventing concurrent changes) I
          > > wondered whether it was acceptable to make ETags (i.e. presence of
          > > an If-Match header for PUT, DELETE and maybe POST where applicable)
          > > mandatory.
          > > In RFC 2616 I could not find any evidence that this allowed or
          > > forbidden. But I might have overlooked it.
          > > If you consider it acceptable: which status code would you return to
          > > a client that did not provide an appropriate header? Well certainly
          > > one of the 4xx errors, but I'm not sure which to choose in particular.
          >
          > Incidently I asked the same thing a while ago and it has been
          > suggested to use 412 Precondition Failed + explanatory text.
          >
          > Sounded like the best idea.
          > ...

          Nope (I think):

          "The precondition given in one or more of the request-header fields
          evaluated to false when it was tested on the server. This response code
          allows the client to place preconditions on the current resource
          metainformation (header field data) and thus prevent the requested
          method from being applied to a resource other than the one intended." --
          <http://greenbytes.de/tech/webdav/rfc2616.html#rfc.section.10.4.13>

          Note the first sentence.

          My recommendation would be 403.

          BR, Julian
        • Jan Algermissen
          ... Oh, never thought of that one. It s better, I agree. Thanks. Jan
          Message 4 of 6 , Aug 28, 2009
            On Aug 28, 2009, at 3:52 AM, Julian Reschke wrote:

            >
            >
            > My recommendation would be 403.

            Oh, never thought of that one. It's better, I agree. Thanks.

            Jan



            >
            > BR, Julian
            >
            >
            > ------------------------------------
            >
            > Yahoo! Groups Links
            >
            >
            >
          • Paul K Moore
            For others stumbling upon this thread, there s also a draft RFC that introduces 428 - Precondition Required See Jan s response here:
            Message 5 of 6 , May 16, 2012
              For others stumbling upon this thread, there's also a draft RFC that introduces '428 - Precondition Required'


              Best regards

              Paul
              --- In rest-discuss@yahoogroups.com, Jan Algermissen <algermissen1971@...> wrote:
              >
              >
              > On Aug 28, 2009, at 3:52 AM, Julian Reschke wrote:
              >
              > >
              > >
              > > My recommendation would be 403.
              >
              > Oh, never thought of that one. It's better, I agree. Thanks.
              >
              > Jan
              >
              >
              >
              > >
              > > BR, Julian
              > >
              > >
              > > ------------------------------------
              > >
              > > Yahoo! Groups Links
              > >
              > >
              > >
              >
            • Julian Reschke
              ...
              Message 6 of 6 , May 16, 2012
                On 2012-05-16 12:22, Paul K Moore wrote:
                > For others stumbling upon this thread, there's also a draft RFC that
                > introduces '428 - Precondition Required'
                >
                > See Jan's response here:
                > http://tech.dir.groups.yahoo.com/group/rest-discuss/message/18802
                > ...

                <http://greenbytes.de/tech/webdav/rfc6585.html#status-428>
              Your message has been successfully submitted and would be delivered to recipients shortly.