Re: [apps-discuss] draft-nottingham-http-problem-04 and content types

Erik Wilde <dret@berkeley.edu> Mon, 04 November 2013 03:54 UTC

Return-Path: <dret@berkeley.edu>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6923121E8089 for <apps-discuss@ietfa.amsl.com>; Sun, 3 Nov 2013 19:54:44 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.599
X-Spam-Level:
X-Spam-Status: No, score=-6.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4]
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 LOLGjy9oj50e for <apps-discuss@ietfa.amsl.com>; Sun, 3 Nov 2013 19:54:40 -0800 (PST)
Received: from cm03fe.IST.Berkeley.EDU (cm03fe.IST.Berkeley.EDU [169.229.218.144]) by ietfa.amsl.com (Postfix) with ESMTP id 40CB611E817B for <apps-discuss@ietf.org>; Sun, 3 Nov 2013 19:54:40 -0800 (PST)
Received: from [207.194.238.3] (helo=dretair.local) by cm03fe.ist.berkeley.edu with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (auth plain:dret@berkeley.edu) (envelope-from <dret@berkeley.edu>) id 1VdBFJ-0000ww-Bd; Sun, 03 Nov 2013 19:54:34 -0800
Message-ID: <52771A72.8090604@berkeley.edu>
Date: Sun, 03 Nov 2013 19:54:26 -0800
From: Erik Wilde <dret@berkeley.edu>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
MIME-Version: 1.0
To: Daniel Spangler <daniel.spangler@gmail.com>, apps-discuss@ietf.org
References: <CAJQ_3CmNa+O9QR5D8STkS8_NGz7Ck626N5cROegWxpJakKtiAA@mail.gmail.com>
In-Reply-To: <CAJQ_3CmNa+O9QR5D8STkS8_NGz7Ck626N5cROegWxpJakKtiAA@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 7bit
Subject: Re: [apps-discuss] draft-nottingham-http-problem-04 and content types
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/apps-discuss>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 04 Nov 2013 03:54:44 -0000

hello daniel.

On 2013-11-03, 19:40 , Daniel Spangler wrote:
> The spec introduces two new content types application/api-problem+xml
> and application/api-problem+json that an error response would contain.
> How do you envision knowing which one of these to return?  Would it be
> something statically defined, derived from the accept type, or
> specifically declared in the accept type?  Is there any concern with
> returning a content type that is not explicitly defined in the accept
> header?

i don't think there's anything special about the HTTP problem types 
here. if a server supports both variants, and a client does not specify 
a preferred variant, or does not distinguish which one it prefers when 
asking for both, then it's up to the server to respond which whatever it 
thinks is the better default choice:

- maybe JSON because on average, people seem to like JSON better these days.

- maybe XML, because you can associate it with an XSLT and thus render a 
nice human-readable response in a browser.

it really is up to the server to decide what to do; it could even serve 
XML/XSLT to browser clients, and JSON to non-browser clients. as 
http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-24#section-5.3.2 
puts it:

"A request without any Accept header field implies that the user agent 
will accept any media type in response."

cheers,

dret.

-- 
erik wilde | mailto:dret@berkeley.edu  -  tel:+1-510-2061079 |
            | UC Berkeley  -  School of Information (ISchool) |
            | http://dret.net/netdret http://twitter.com/dret |