Received: by 10.68.201.168 with SMTP id kb8mr1982469pbc.3.1335463037280; Thu, 26 Apr 2012 10:57:17 -0700 (PDT) X-BeenThere: api-craft@googlegroups.com Received: by 10.68.222.193 with SMTP id qo1ls3184834pbc.9.gmail; Thu, 26 Apr 2012 10:57:15 -0700 (PDT) Received: by 10.68.236.170 with SMTP id uv10mr6640196pbc.4.1335463035278; Thu, 26 Apr 2012 10:57:15 -0700 (PDT) Received: by 10.68.236.170 with SMTP id uv10mr6640195pbc.4.1335463035263; Thu, 26 Apr 2012 10:57:15 -0700 (PDT) Return-Path: Received: from va3outboundpool.messaging.microsoft.com (va3ehsobe002.messaging.microsoft.com. [216.32.180.12]) by gmr-mx.google.com with ESMTPS id sg8si1940021pbc.0.2012.04.26.10.57.15 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 Apr 2012 10:57:15 -0700 (PDT) Received-SPF: pass (google.com: domain of Arlo.Bels...@microsoft.com designates 216.32.180.12 as permitted sender) client-ip=216.32.180.12; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of Arlo.Bels...@microsoft.com designates 216.32.180.12 as permitted sender) smtp.mail=Arlo.Bels...@microsoft.com Received: from mail171-va3-R.bigfish.com (10.7.14.239) by VA3EHSOBE007.bigfish.com (10.7.40.11) with Microsoft SMTP Server id 14.1.225.23; Thu, 26 Apr 2012 17:57:13 +0000 Received: from mail171-va3 (localhost [127.0.0.1]) by mail171-va3-R.bigfish.com (Postfix) with ESMTP id B039780526 for ; Thu, 26 Apr 2012 17:57:12 +0000 (UTC) X-SpamScore: -15 X-BigFish: VS-15(zz9371I542M1432N98dKzz1202hzz8275bhz2fh2a8h683h839h944hd25h) X-Forefront-Antispam-Report: CIP:131.107.125.8;KIP:(null);UIP:(null);IPV:NLI;H:TK5EX14MLTC104.redmond.corp.microsoft.com;RD:none;EFVD:NLI Received-SPF: pass (mail171-va3: domain of microsoft.com designates 131.107.125.8 as permitted sender) client-ip=131.107.125.8; envelope-from=Arlo.Bels...@microsoft.com; helo=TK5EX14MLTC104.redmond.corp.microsoft.com ;icrosoft.com ; Received: from mail171-va3 (localhost.localdomain [127.0.0.1]) by mail171-va3 (MessageSwitch) id 1335463019889693_13162; Thu, 26 Apr 2012 17:56:59 +0000 (UTC) Received: from VA3EHSMHS030.bigfish.com (unknown [10.7.14.254]) by mail171-va3.bigfish.com (Postfix) with ESMTP id C9489602EE for ; Thu, 26 Apr 2012 17:56:59 +0000 (UTC) Received: from TK5EX14MLTC104.redmond.corp.microsoft.com (131.107.125.8) by VA3EHSMHS030.bigfish.com (10.7.99.40) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 26 Apr 2012 17:56:59 +0000 Received: from db3outboundpool.messaging.microsoft.com (157.54.51.81) by mail.microsoft.com (157.54.79.159) with Microsoft SMTP Server (TLS) id 14.2.298.5; Thu, 26 Apr 2012 17:56:50 +0000 Received: from mail114-db3-R.bigfish.com (10.3.81.229) by DB3EHSOBE005.bigfish.com (10.3.84.25) with Microsoft SMTP Server id 14.1.225.23; Thu, 26 Apr 2012 17:56:20 +0000 Received: from mail114-db3 (localhost [127.0.0.1]) by mail114-db3-R.bigfish.com (Postfix) with ESMTP id B40911807DF for ; Thu, 26 Apr 2012 17:56:20 +0000 (UTC) Received: from mail114-db3 (localhost.localdomain [127.0.0.1]) by mail114-db3 (MessageSwitch) id 1335462979246919_28096; Thu, 26 Apr 2012 17:56:19 +0000 (UTC) Received: from DB3EHSMHS006.bigfish.com (unknown [10.3.81.234]) by mail114-db3.bigfish.com (Postfix) with ESMTP id 385E130007C for ; Thu, 26 Apr 2012 17:56:19 +0000 (UTC) Received: from CH1PRD0310HT005.namprd03.prod.outlook.com (157.56.244.37) by DB3EHSMHS006.bigfish.com (10.3.87.106) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 26 Apr 2012 17:56:18 +0000 Received: from CH1PRD0310MB380.namprd03.prod.outlook.com ([169.254.11.23]) by CH1PRD0310HT005.namprd03.prod.outlook.com ([10.255.137.40]) with mapi id 14.16.0152.000; Thu, 26 Apr 2012 17:56:18 +0000 From: Arlo Belshee To: "api-craft@googlegroups.com" Subject: RE: Response code when POSTing existing resource Thread-Topic: Response code when POSTing existing resource Thread-Index: AQHNCvvlLoZiwEKFY06kbfhd3F53K5Z8nPMAgAAX2gCACyb2AIAlQfIAgAANOICAAFwr8IAABvKAgAAAgFA= Date: Thu, 26 Apr 2012 17:56:17 +0000 Message-ID: <51D30573C07F2D41A6DE9D263913295328426...@CH1PRD0310MB380.namprd03.prod.outlook.com> References: <551691cb-5469-458c-9c77-82e6c7573...@n5g2000vbf.googlegroups.com> <23002568.219.1332770712450.JavaMail.geo-discussion-forums@vblo18> <29235383.1503.1335437190987.JavaMail.geo-discussion-forums@vbq5> <51D30573C07F2D41A6DE9D263913295328426...@CH1PRD0310MB380.namprd03.prod.outlook.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [131.107.192.197] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OrganizationHeadersPreserved: CH1PRD0310HT005.namprd03.prod.outlook.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% X-FOPE-CONNECTOR: Id%59$Dn%GOOGLEGROUPS.COM$RO%2$TLS%6$FQDN%131.107.125.5$TlsDn% X-CrossPremisesHeadersPromoted: TK5EX14MLTC104.redmond.corp.microsoft.com X-CrossPremisesHeadersFiltered: TK5EX14MLTC104.redmond.corp.microsoft.com Return-Path: Arlo.Bels...@microsoft.com X-OriginatorOrg: microsoft.com Sorry, do you mean this is an 'issue' because you can't smoothly switch a r= esource's behaviour from sync w/ 200 to async w/ 202? You're right, that is= impractical ! :) No, I mean that this is an issue because if I ever use a 202 response code = to a request on an API for which I don't own the clients, then invariably p= eople write clients that include code like: if(response.status / 100 =3D=3D 2) { // 2xx handlers.success(response.head, response.body); } else { // possibly differentiate between 3xx, 4xx, and 5xx here, or not. handlers.fail(response.head, response.body); } And then they get subtle errors and they (and their users) complain that th= ere's a bug in the service (it isn't reporting an error when one happens). If I can control or strongly influence the clients then I can use all sorts= of HTTP features (partial GET, async processing, etc) that I can't use whe= n I'm targeting a general client audience. Arlo -----Original Message----- From: api-craft@googlegroups.com [mailto:api-craft@googlegroups.com] On Beh= alf Of Mike Kelly Sent: Thursday, April 26, 2012 10:29 AM To: api-craft@googlegroups.com Subject: Re: Response code when POSTing existing resource Hi Ario, On Thu, Apr 26, 2012 at 6:12 PM, Arlo Belshee = wrote: > Well, "2xx means OK" includes one misconception. It ignores 202, which in= tentionally states that the error state is currently unknown. 2xx doesn't mean OK, 2xx means success - which is what the spec says: "This class of status code indicates that the client's request was successf= ully received, understood, and accepted." Either way, Duncan's advice to use 2xx in response to a client error is wro= ng. > The fact that lots of client developers think "2xx =3D=3D OK" makes it di= fficult to write servers that really do async processing. 202 is great if y= ou own the clients. If you're handling generic clients, the "install base" = of client developer thinking is too entrenched to really let you use it. > > Thus people end up lifting async (a processing concern) to the resource l= evel. They create resources like "transaction" or "batch" so that they can = represent async without using the HTTP async primitives. > > Oh well - another case where HTTP usable in practice is only a subset of = HTTP in spec. Sorry, do you mean this is an 'issue' because you can't smoothly switch a r= esource's behaviour from sync w/ 200 to async w/ 202? You're right, that is= impractical ! :) Cheers, Mike