[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Using Link header in HTTP 4xx response
- To: "atom-protocol Protocol" <atom-protocol@xxxxxxx>
- Subject: Using Link header in HTTP 4xx response
- From: "Teo Hui Ming" <teohuiming.work@xxxxxxxxx>
- Date: Wed, 23 Apr 2008 14:17:42 +0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=F+Njevkc/lfsdeItcU6rmK7kB6v5+CBEHzknJe88XqE=; b=JkaQcZ3gp3Ccia++pXaWAQHKIXDX2gXs7jq7DVmMhRIWJsVV4scJ9mH4/O2n7lmrT+pDb4kgiCQo5ZazXDWCr1K39AmvZJ0vegUrrBwClVkCcrNdm9e7t/S8zJ4tOpknLlkdxRj9d+4g9IhXLUnbVjAmgWbgTojqGE6iEoIH8Mg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=SUSlhpSvOkjLVNTbHnIckIhW4Ay9VcMw6HuB6fLB9+OljBSTzMbWUzW71ezgV22Ld3bAPXC84PeoNakC3U47Cy6pa5k4HDqsTT1sUkhkkORPGS17SigGsck+y+bA5dHnfXt10yJPbD+3EPC8qEdlUh1lMdOZNg3R3SHucjZnrJU=
- List-archive: <http://www.imc.org/atom-protocol/mail-archive/>
- List-id: <atom-protocol.imc.org>
- List-unsubscribe: <mailto:atom-protocol-request@imc.org?body=unsubscribe>
- Sender: owner-atom-protocol@xxxxxxxxxxxx
Hi,
Here's the use case.
A bookmark collection rejects duplicate bookmarks. But client may
handle a 'duplicate bookmark' error automatically (based on
user-defined settings, e.g. always overwrite the existing duplicate
bookmark), if the duplicate bookmark entry's URI is given to client.
So, this URI should appear in the error response.
Rather than placing the URI in message body and require client to
parse the body, I was thinking about moving the URI into a HTTP Link
header with a 'duplicate' relation:
> POST /bookmarks/
# request to create a bookmark entry
< HTTP/1.1 409 Conflict
Content-Type: text/html
Content-Length: nn
Link: </bookmarks/2>; rel="duplicate"
A same bookmark entry already exists <a
rel="duplicate" href="/bookmark/2">here</a>.
You can either remove or overwrite this
existing bookmark.
I'm not sure if the current Link header definition accepts such
interpretation, since the entity in a 4xx response is an error
message, and does not represent a Web resource.
In draft-nottingham-http-link-header-01 [1], Section 3:
"The Link entity-header field provides a means for describing a
relationship between two resources, generally between that of the
entity associated with the header and some other resource. An entity
MAY include multiple Link values."
Thoughts?
[1] http://www.ietf.org/internet-drafts/draft-nottingham-http-link-header-01.txt
--
Teo Hui Ming