Re: Link relation types for non-GET links

algermissen1971 <algermissen1971@icloud.com> Sat, 15 August 2015 13:03 UTC

Return-Path: <algermissen1971@icloud.com>
X-Original-To: link-relations@ietfa.amsl.com
Delivered-To: link-relations@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 84FFF1A8924 for <link-relations@ietfa.amsl.com>; Sat, 15 Aug 2015 06:03:37 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001] autolearn=ham
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 SJlBpOKrx0-z for <link-relations@ietfa.amsl.com>; Sat, 15 Aug 2015 06:03:36 -0700 (PDT)
Received: from pv33p03im-asmtp001.me.com (pv33p03im-asmtp001.me.com [17.143.180.10]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id F10C91A88FD for <link-relations@ietf.org>; Sat, 15 Aug 2015 06:03:35 -0700 (PDT)
Received: from [10.31.33.34] (fw.gkh-setu.de [80.69.33.177]) by pv33p03im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Mar 31 2015)) with ESMTPSA id <0NT400GJZK9J8D10@pv33p03im-asmtp001.me.com> for link-relations@ietf.org; Sat, 15 Aug 2015 13:03:35 +0000 (GMT)
Content-type: text/plain; charset="us-ascii"
MIME-version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
Subject: Re: Link relation types for non-GET links
From: algermissen1971 <algermissen1971@icloud.com>
In-reply-to: <55CF2EBE.5060203@gmx.de>
Date: Sat, 15 Aug 2015 15:03:18 +0200
Content-transfer-encoding: quoted-printable
Message-id: <562D0D35-70BE-46A3-899D-4A4184F33CC1@icloud.com>
References: <CAAzbHvb==Sn_4UUFHKs3H9GYbEfiX=TUjv4FSmNi9R4NEB+DvQ@mail.gmail.com> <CAPW_8m5CU++j=8tNBK1Q7KszxsfORnK1-6mxcgUwz9X2R2JTyA@mail.gmail.com> <CAAzbHvZGYGNOkuAkc7Fu29maDcbjSf_o54q93Xa+Ggk_fkGHAw@mail.gmail.com> <55CC8C1D.9060900@gmx.de> <CAAzbHva19zw8tzKxSxhMFUSV0RLMFjq94Pb5Z4mc8GseEgrkBw@mail.gmail.com> <55CF2EBE.5060203@gmx.de>
To: Klaus Hartke <hartke@tzi.org>
X-Mailer: Apple Mail (2.1878.6)
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.14.151,1.0.33,0.0.0000 definitions=2015-08-15_02:2015-08-13,2015-08-15,1970-01-01 signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1508150151
Archived-At: <http://mailarchive.ietf.org/arch/msg/link-relations/E9uvqFDLnCWDI8rTq_RVFw4chPI>
Cc: Julian Reschke <julian.reschke@gmx.de>, link-relations <link-relations@ietf.org>
X-BeenThere: link-relations@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <link-relations.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/link-relations>, <mailto:link-relations-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/link-relations/>
List-Post: <mailto:link-relations@ietf.org>
List-Help: <mailto:link-relations-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/link-relations>, <mailto:link-relations-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 15 Aug 2015 13:03:37 -0000

Klaus,

you are trying to mix "resource semantics" with "runtime information".

Links (any form of hypermedia for that matter) tell the user agent whatthe nature of the resource is ("A feed of entries" , "a resource that supports search", "a product catalog","a product details page", "an index"..)

REST deliberately decouples resource semantics from any runtime specifics (e.g. which method does a resource support at any given point in time). The consequence is that a specification of a link relation can never actuallt constrain meaningfully a server  to any specific runtime behavior. Link relation specs can provide *hints* for implementors what make sense to support, but these can only ever be just that: hints. The client must deal with what happens at runtime anyway.

Sometimes it can help to provide explicit runtime deatils about the method (think about HTML forms' "action" attribute), but frankly, separate syntax constructs (==link relation types) are usually better (after all, a resource that supports indexing into (GET form) is very different from a resource that you can submitt stuff to (POST form).

Ususally (if not allways) you will find that making the supported method design time information (specs) rather than runtime information seems necessary at first, but when it comes to putting the method in the client request code, it will be obvious anyway, which of the handfull of methods to use.

And if the clients sends a PATCH and the server at runtime does not deliver on whatever promise a spec made - what's the spec going to help? The client must figure out the method to use from the response headers anyhow, or apply common sense and retry with the POST ... or give up and hand the issue to a human for resolution.

(REST does not magically solve the contract issues of decentralized systems, it just prescribes very explicitly the places where they surface at runetime - do not constrain at design time what makes no sense to constrain enyway).

HTH,

Jan


On 15 Aug 2015, at 14:21, Julian Reschke <julian.reschke@gmx.de> wrote:

> On 2015-08-15 14:16, Klaus Hartke wrote:
>> Julian Reschke wrote:
>>>> How does a spider distinguish between safe links and unsafe non-GET links?
>>> 
>>> A spider is not supposed to use methods other than GET, so how is this a
>>> problem?
>> 
>> If the spider does not know the link relation type, it will assume
>> that there is a safe link between the two resources even when the link
>> relation type defines the link to be unsafe. But maybe that's not a
>> big problem.
> 
> The link relation by definition can not be "unsafe".
> 
>> It's just that HTML defines a number of syntactically different
>> hypermedia controls (<a>, <img>, <form>), so a spider can understand
>> whether the link is safe or not even if it does not recognize the link
>> relation type.
> 
> The link is always safe; it's the method applied to the link target which might not.
> 
> Best regards, Julian
> 
> _______________________________________________
> link-relations mailing list
> link-relations@ietf.org
> https://www.ietf.org/mailman/listinfo/link-relations