The Idempotency HTTP Header Field
draft-idempotency-header-01

Document Type Active Internet-Draft (individual)
Authors Jayadeba Jena  , Sanjay Dalal 
Last updated 2020-11-23
Stream (None)
Intended RFC status (None)
Formats plain text xml pdf htmlized (tools) htmlized bibtex
Stream Stream state (No stream defined)
Consensus Boilerplate Unknown
RFC Editor Note (None)
IESG IESG state I-D Exists
Telechat date
Responsible AD (None)
Send notices to (None)
Network Working Group                                            J. Jena
Internet-Draft                                              PayPal, Inc.
Intended status: Standards Track                                S. Dalal
Expires: May 27, 2021                                  November 23, 2020

                   The Idempotency HTTP Header Field
                      draft-idempotency-header-01

Abstract

   The "HTTP" Idempotency request header field can be used to carry
   idempotency key in order to make non-idempotent "HTTP" methods such
   as "POST" or "PATCH" fault-tolerant.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at https://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on May 27, 2021.

Copyright Notice

   Copyright (c) 2020 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (https://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Jena & Dalal              Expires May 27, 2021                  [Page 1]
Internet-Draft      The Idempotency HTTP Header Field      November 2020

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
     1.1.  Notational Conventions  . . . . . . . . . . . . . . . . .   3
   2.  The Idempotency HTTP Request Header Field . . . . . . . . . .   3
     2.1.  Syntax  . . . . . . . . . . . . . . . . . . . . . . . . .   3
     2.2.  Uniqueness of Idempotency Key . . . . . . . . . . . . . .   4
     2.3.  Idempotency Key Validity and Expiry . . . . . . . . . . .   4
     2.4.  Idempotency Fingerprint . . . . . . . . . . . . . . . . .   4
     2.5.  Responsibilities  . . . . . . . . . . . . . . . . . . . .   4
     2.6.  Idempotency Enforcement Scenarios . . . . . . . . . . . .   5
     2.7.  Error Scenarios . . . . . . . . . . . . . . . . . . . . .   6
   3.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   6
     3.1.  The Idempotency-Key HTTP Request Header Field . . . . . .   6
   4.  Implementation Status . . . . . . . . . . . . . . . . . . . .   7
     4.1.  Implementing the Concept  . . . . . . . . . . . . . . . .   8
   5.  Security Considerations . . . . . . . . . . . . . . . . . . .  10
   6.  Examples  . . . . . . . . . . . . . . . . . . . . . . . . . .  10
   7.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  11
     7.1.  Normative References  . . . . . . . . . . . . . . . . . .  11
     7.2.  Informative References  . . . . . . . . . . . . . . . . .  11
   Appendix A.  Acknowledgments  . . . . . . . . . . . . . . . . . .  12
   Appendix B.  Appendix . . . . . . . . . . . . . . . . . . . . . .  12
     B.1.  Appendix A.  Imported ABNF  . . . . . . . . . . . . . . .  12
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  12

1.  Introduction

   Idempotence is the property of certain operations in mathematics and
   computer science whereby they can be applied multiple times without
   changing the result beyond the initial application.  It does not
   matter if the operation is called only once, or 10s of times over.
   The result "SHOULD" be the same.

   Idempotency is important in building a fault-tolerant "HTTP API".  An
   "HTTP" request method is considered "idempotent" if the intended
   effect on the server of multiple identical requests with that method
   is the same as the effect for a single such request.  According to
   [RFC7231], "HTTP" methods "OPTIONS", "HEAD", "GET", "PUT" and
   "DELETE" are idempotent while methods "POST" and "PATCH" are not.

   Let's say a client of an "HTTP API" wants to create (or update) a
   resource using a "POST" method.  Since "POST" is "NOT" an idempotent
   method, calling it multiple times can result in duplication or wrong
   updates.  Consider a scenario where the client sent a "POST" request
   to the server, but it got a timeout.  Following questions arise : Is
   the resource actually created (or updated)?  Did the timeout occur
Show full document text