Re: Registration Request for the respond-for HTTP preference

Michael Toomim <toomim@gmail.com> Mon, 08 June 2020 07:27 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 62FBD3A0920 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 8 Jun 2020 00:27:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.738
X-Spam-Level:
X-Spam-Status: No, score=-7.738 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, T_MIME_MALF=0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gWrzx2RAMOw3 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 8 Jun 2020 00:27:44 -0700 (PDT)
Received: from lyra.w3.org (lyra.w3.org [128.30.52.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 854343A091E for <httpbisa-archive-bis2Juki@lists.ietf.org>; Mon, 8 Jun 2020 00:27:44 -0700 (PDT)
Received: from lists by lyra.w3.org with local (Exim 4.92) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1jiC9K-00055L-Px for ietf-http-wg-dist@listhub.w3.org; Mon, 08 Jun 2020 07:24:50 +0000
Resent-Date: Mon, 08 Jun 2020 07:24:50 +0000
Resent-Message-Id: <E1jiC9K-00055L-Px@lyra.w3.org>
Received: from mimas.w3.org ([128.30.52.79]) by lyra.w3.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <toomim@gmail.com>) id 1jiC9I-00054a-Uf for ietf-http-wg@listhub.w3.org; Mon, 08 Jun 2020 07:24:48 +0000
Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by mimas.w3.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <toomim@gmail.com>) id 1jiC9H-00011V-9Z for ietf-http-wg@w3.org; Mon, 08 Jun 2020 07:24:48 +0000
Received: by mail-pg1-x530.google.com with SMTP id m1so8383060pgk.1 for <ietf-http-wg@w3.org>; Mon, 08 Jun 2020 00:24:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=CKvBRfL/ZYygj2dNR18mqMEpCGMr8C1LDIGQ4ejaRjo=; b=VFDdLy02/ExIqta31BItyo1pKZQXjW3nHcdkYaZ2Z2R1yx04soqsdNvJIw8mWV/omk tdGzyB8gJ/9WIO0d/N+sIVApUVgE94JbWiK7QshKyLkFeKnUualp65Sw3JB1u+aF5LO0 k0Wf75ml98RjVvxfPuHE6YgmXmjUSY88L3xj/VRsUzIJsGxEwyFGg0COsmA2PSFpFIIg 6LYc+QWHulM1SoSxWdM9kPBmzgO5UETln8d2knBC0Y6x7TzlRpcOGjE6w5i2YEzrn9Qj OboiH0+meX+k6u1Eu+2dRjEhGvEWBapjLikORvZe7pG7LgP+5XtM+oWaPDPJ/jzqafsS uCoA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=CKvBRfL/ZYygj2dNR18mqMEpCGMr8C1LDIGQ4ejaRjo=; b=SAoeAOGk3rTUyCG1qFD9AX1hSiLKmiw7uKaue/Qo33d6d55JPSPQ66gg3vpeeikyyE 5W9MufgeRQ4Z2Rv3lvmxOerbEtvNLN+EIPYBQsG6pG0Mo5lp5NADCt0w0N+mG6lXHCtz I/m494jLE9MD2iqZxLqV/PDmIniwNxEWl1O5YJB0CFNNX1/jli/kYYEFnI4gh7f6ratV jzph5xdoXT9Do08GIbzV3HEjYGSRtOqExqG8rjTmtNr0xjFtCWtj/x1ZSUS6coa7e+Rz Xp4QwW+EUV816KhSjxdcd+pYFua295kRpTzmU1Lo94V3bcMXv29A3QKhlzE/5tQJ+wr3 AwNw==
X-Gm-Message-State: AOAM532w13QsvLvCmvrAN2yaix0RaimHj+UuaXzRdUg3iTG040ZUeEV3 i8deoRT+ysqnK5yp5uXXe6M=
X-Google-Smtp-Source: ABdhPJzEfAwe2+PJDlw0FQaW5Dq4ZSSiDYdA5wRLNu86I4LWhNsqiCkXGZAK3I5uNxUglZd0v+GpPw==
X-Received: by 2002:a63:d54b:: with SMTP id v11mr18773748pgi.198.1591601075914; Mon, 08 Jun 2020 00:24:35 -0700 (PDT)
Received: from [192.168.1.16] (c-76-126-181-172.hsd1.ca.comcast.net. [76.126.181.172]) by smtp.gmail.com with ESMTPSA id g21sm6128708pfh.134.2020.06.08.00.24.35 (version=TLS1 cipher=ECDHE-ECDSA-AES128-SHA bits=128/128); Mon, 08 Jun 2020 00:24:35 -0700 (PDT)
Content-Type: multipart/alternative; boundary="Apple-Mail=_0CF20663-5AA0-42F2-855C-D529ECA5D944"
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
From: Michael Toomim <toomim@gmail.com>
In-Reply-To: <CACTPbXPJBbpH97-gcaV7waWARXUfP4nXB_zZqvRakVZP-uEZgg@mail.gmail.com>
Date: Mon, 8 Jun 2020 00:24:34 -0700
Cc: ietf-http-wg@w3.org
Message-Id: <61198458-2023-4F6D-9032-1F028CFEF446@gmail.com>
References: <CACTPbXPJBbpH97-gcaV7waWARXUfP4nXB_zZqvRakVZP-uEZgg@mail.gmail.com>
To: irakli <irakli@gmail.com>
X-Mailer: Apple Mail (2.3124)
Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=toomim@gmail.com; helo=mail-pg1-x530.google.com
X-W3C-Hub-Spam-Status: No, score=-4.1
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_MIME_MALF=0.01, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: mimas.w3.org 1jiC9H-00011V-9Z 07e5724485281b369b62a449132cf8ee
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Registration Request for the respond-for HTTP preference
Archived-At: <https://www.w3.org/mid/61198458-2023-4F6D-9032-1F028CFEF446@gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/37730
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <https://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

Irakli, thank you for this submission. I am quite interested in giving HTTP functionality from GraphQL.

In your approach, the server and client agree on a set of "bundles" of data to transmit, such as `minimal` or `full_representation`. This is cool! But I am curious why you want to specify which bundle to request using the `Prefer` header, rather than just in the URL?

For instance, what is the advantage of doing this:

  Get /users/123 HTTP/1.1
  Host: api.example.org
  Content-Type: application/json  
  Prefer: return=minimal
  Vary: Prefer,Accept,Accept-Encoding

Rather than this:

  Get /users/123?subset=minimal HTTP/1.1
  Host: api.example.org
  Content-Type: application/json  
  Vary: Prefer,Accept,Accept-Encoding
?

The reference blog post suggests that the problem with embedding the bundle-id in the URL is that it couples the client with the server. However, this is the case with specifying the bundle-id in the Prefer header as well.

> On Apr 27, 2020, at 7:06 PM, irakli <irakli@gmail.com> wrote:
> 
>    o  Preference: respond-for
> 
>    o  Value: any alpha-numeric value. Dashes are also allowed.
> 
>    o  Optional Parameters: None
> 
>    o  Description: Expanded version of the "return" preference that 
> allows clients to hint to the server the use-case for the response.
> This allows batching response variations by common use-cases. The goal
> is similar to GraphQL: letting client choose which data it needs, but
> is significantly more light-weight and can allow all that client needs
> in a very wide variety of cases, without resorting to heavier and 
> potentially riskier GraphQL approach. For instance, for a blog post
> a client may request "respond-for: teaser" or "respond-for: full-post"  
> 
>    o  Reference: https://www.freshblurbs.com/blog/2015/06/25/api-representations-prefer.html <https://www.freshblurbs.com/blog/2015/06/25/api-representations-prefer.html>
> 
>    o  Notes: We have used this approach successfully at a number of 
> companies over the years but would like to standardize the preference
> rather than using an unregistered preference, or using the "return" 
> preference with values that are non-standard.
> 
> 
> Thank you!
> 
> Irakli Nadareishvili