Re: HTTP in JSON Binary Encoding / Data Model

Phillip Hallam-Baker <hallam@gmail.com> Wed, 29 May 2013 17:24 UTC

Return-Path: <ietf-http-wg-request@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 9E72021F8FD0 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 29 May 2013 10:24:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -10.598
X-Spam-Level:
X-Spam-Status: No, score=-10.598 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ElKIQHsEj-a6 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 29 May 2013 10:24:22 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id 2ACDA21F8EA5 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Wed, 29 May 2013 10:24:14 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1Uhk5t-0005dS-Or for ietf-http-wg-dist@listhub.w3.org; Wed, 29 May 2013 17:23:25 +0000
Resent-Date: Wed, 29 May 2013 17:23:25 +0000
Resent-Message-Id: <E1Uhk5t-0005dS-Or@frink.w3.org>
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <hallam@gmail.com>) id 1Uhk5g-0005c5-6V for ietf-http-wg@listhub.w3.org; Wed, 29 May 2013 17:23:12 +0000
Received: from mail-we0-f170.google.com ([74.125.82.170]) by maggie.w3.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.72) (envelope-from <hallam@gmail.com>) id 1Uhk5e-00024N-Uw for ietf-http-wg@w3.org; Wed, 29 May 2013 17:23:12 +0000
Received: by mail-we0-f170.google.com with SMTP id u59so5978107wes.15 for <ietf-http-wg@w3.org>; Wed, 29 May 2013 10:22:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Ldg4RlKKhJ6uSfhYGU9QKxx/WzlSRsa7f9v9nrVMbbI=; b=qGOw/df1tN845Ae6BFDDR3QYGzBVgGnHLbm7thuM3hWjh1uB2/w6vJ03Z/8Y738TON OPk/ISUChgHXRKRrBR7oeld7ljYBDdOz2+dnNtEBwiVwPXvEjP92PPvzdKlKucHNWEjG Qs0cgFJU+kpm4qul+eOnEEMw4ggqAqaZoPmZa8UyckaSN4a6DMEBGfy/huqkFSnu0Cao bo8sKfAOqas9NV5z865LEkbDEBotY3mdSfl88DgfF//DdOrr3n0K7i7GQWlibDRFCNET gZNY2BZddUgx+jjCiMU33DvBDbDdjmqW59AgcuzwT7nxQoXhWGuKJk4YI2DMKZaBCJgT qbAA==
MIME-Version: 1.0
X-Received: by 10.180.205.177 with SMTP id lh17mr16121245wic.45.1369848164856; Wed, 29 May 2013 10:22:44 -0700 (PDT)
Received: by 10.194.44.100 with HTTP; Wed, 29 May 2013 10:22:44 -0700 (PDT)
In-Reply-To: <CABP7Rbesg729wNixRQHrR3goD56DmcQ=bWm6OOvkdLeLE4fK_Q@mail.gmail.com>
References: <CAMm+LwjTFm3prX2emJxWpZKfnRzgvvK+H9Rgz1AAoXBTQd=kTw@mail.gmail.com> <CABP7Rbesg729wNixRQHrR3goD56DmcQ=bWm6OOvkdLeLE4fK_Q@mail.gmail.com>
Date: Wed, 29 May 2013 13:22:44 -0400
Message-ID: <CAMm+LwgQqK-9TQvNxMmzpvG+WOF_R2Ga1oXwnaesTsN_ovPVfQ@mail.gmail.com>
From: Phillip Hallam-Baker <hallam@gmail.com>
To: James M Snell <jasnell@gmail.com>
Cc: "ietf-http-wg@w3.org Group" <ietf-http-wg@w3.org>
Content-Type: multipart/alternative; boundary="001a11c37dd8433b5904dddea10a"
Received-SPF: pass client-ip=74.125.82.170; envelope-from=hallam@gmail.com; helo=mail-we0-f170.google.com
X-W3C-Hub-Spam-Status: No, score=-3.3
X-W3C-Hub-Spam-Report: AWL=-2.522, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001
X-W3C-Scan-Sig: maggie.w3.org 1Uhk5e-00024N-Uw bec332e95bf68bdc65b0d5298d21e5b2
X-Original-To: ietf-http-wg@w3.org
Subject: Re: HTTP in JSON Binary Encoding / Data Model
Archived-At: <http://www.w3.org/mid/CAMm+LwgQqK-9TQvNxMmzpvG+WOF_R2Ga1oXwnaesTsN_ovPVfQ@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/18147
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: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

On Wed, May 29, 2013 at 12:44 PM, James M Snell <jasnell@gmail.com> wrote:

> I understand what you're getting at and understand the motivations
> behind it. A few comments however...
>
> 1. Having a clear separation between Protocol and Application
> Semantics is a Good Thing.
>

Agreed. But the issue is whether to use a different syntax.

I would imagine that the JSON encoding would look something like:

Object: HTTP-Message
    List [Object] Headers
    Object  Content
        List [Object] Metadata
        Binary  Content

So the content would still be a binary blob as far ass HTTPdom goes. But
the same parser could break apart the envelope and the contents for a web
service.



> 2. By adopting the "Typed Header Codecs" I have proposed, it would be
> possible to use raw binary values in headers that specifically allow
> for it, which would make it possible to use the proposed "binary json"
> type encoding directly without further protocol modifications and
> without sacrificing backwards compatibility or requiring additional,
> undue complexity.
>

Yeah, it is quite possible that the way to go forward here would be to wait
to see what the HTTP group does and then back port some of that to JSON to
create a binary encoding scheme.

At the very least it would be nice to have a consistent approach. I still
loathe the idea of pushing stuff through libgzip if that is still being
considered.



> 3. While I'm sure there is room for improvement in the typed header
> codecs I've proposed, we have already had a number of conversations on
> the list about data model requirements for http headers. In my
> interpretation (for what it's worth), there was consensus around only
> requiring strings, integers, dates and raw binary as data types, with
> a clear backwards-compatibility story for http/1 and no need for
> anything as expressive as JSON at the protocol level.


Again, the flow of action might be in the opposite direction. Take the HTTP
work and use it to inform a JSON encoding.

That would probably mean we end up with two different encodings for the two
layers. But that is not necessarily a disaster if they take compatible
approaches.


I did initially consider a date type because that is something I define in
my protocol synthesizer/JSON schema tool. Then I removed it as a
distraction. Might be an idea to add it back again as time is a very common
data type for protocols.


-- 
Website: http://hallambaker.com/