Re: More info in the result of a POST?

On 5/5/15 8:55 AM, Robert Sanderson wrote:
>
> Hi Kingsley,
>
> The question was what representations can be retrieved with a GET 
> request, rather than which representations can be sent on a POST 
> request.  The two lists could be different.
>
> Rob
Rob,

A user agent can ask a server that question, and the server can respond 
with appropriate headers.

There is a "Negotiate: " header for that, on the client side, and a 
"Vary:" header on the response side which collectively drive transparent 
content negotiation b/w client and server.

Example:

curl -L -H "Accept: 
text/xml;q=0.3,text/html;q=1.0,text/turtle;q=0.5,*/*;q=0.3" -H 
"Negotiate: *" -I http://dbpedia.org/resource/Analytics
HTTP/1.1 303 See Other
Date: Tue, 05 May 2015 16:01:06 GMT
Content-Type: text/turtle; qs=0.35
Content-Length: 0
Connection: keep-alive
Server: Virtuoso/07.20.3213 (Linux) i686-generic-linux-glibc212-64 VDB
*TCN: choice**
**Vary: negotiate,accept*
*Alternates*: {"/data/Analytics.atom" 0.500000 {type 
application/atom+xml}}, {"/data/Analytics.jrdf" 0.600000 {type 
application/rdf+json}}, {"/data/Analytics.jsod" 0.500000 {type 
application/odata+json}}, {"/data/Analytics.json" 0.600000 {type 
application/json}}, {"/data/Analytics.jsonld" 0.500000 {type 
application/ld+json}}, {"/data/Analytics.n3" 0.800000 {type text/n3}}, 
{"/data/Analytics.nt" 0.800000 {type text/rdf+n3}}, 
{"/data/Analytics.ttl" 0.700000 {type text/turtle}}, 
{"/data/Analytics.xml" 0.950000 {type application/rdf+xml}}
Link: 
<http://mementoarchive.lanl.gov/dbpedia/timegate/http://dbpedia.org/resource/Analytics>; 
rel="timegate"
Location: http://dbpedia.org/data/Analytics.ttl
Expires: Tue, 12 May 2015 16:01:06 GMT
Cache-Control: max-age=604800



Kingsley
>
> On Sun, May 3, 2015 at 11:07 AM, Kingsley Idehen 
> <kidehen@openlinksw.com <mailto:kidehen@openlinksw.com>> wrote:
>
>     On 5/3/15 9:28 AM, Robert Sanderson wrote:
>>     Hi Henry,
>>
>>     My understanding in general (not from the LDP spec) is that you
>>     should return all the headers that you would on a successful GET
>>     on a successful POST, and with a 201 status.
>>
>>     I don't think there's a way to specify all of the possible media
>>     types in which you can get a representation of the resource. 
>>     That would be a huge list with JSON-LD profiles and frames.
>>
>>     HTH
>>
>>     Rob
>
>     Rob,
>
>     Why not? What's wrong with:
>
>     Accept-Post: text/turtle,text/n3,text/nt ?
>
>     This comes from:
>
>     curl -IkH "Origin: http://example.com" -H "Accept: text/turtle"
>     "http://kingsley.idehen.net/DAV/home/kidehen/RWWTests/"
>     <http://kingsley.idehen.net/DAV/home/kidehen/RWWTests/>
>     HTTP/1.1 200 OK
>     Server: Virtuoso/07.50.3213 (Linux)
>     x86_64-redhat-linux-gnu-ANALYTICS  VDB
>     Connection: Keep-Alive
>     Date: Sun, 03 May 2015 18:03:27 GMT
>     Access-Control-Allow-Origin: http://example.com
>     Access-Control-Allow-Credentials: true
>     Access-Control-Expose-Headers:
>     Content-Type,MS-Author-Via,Allow,Accept-Patch,Accept-Post,Vary,Link,ETag,X-SPARQL-default-graph
>     Access-Control-Allow-Headers: Accept, Authorization, Slug, Link,
>     Origin, Content-type
>     Accept-Ranges: bytes
>     Content-Type: text/turtle
>     MS-Author-Via: DAV, SPARQL
>     Allow:
>     GET,HEAD,POST,PUT,DELETE,OPTIONS,PROPFIND,PROPPATCH,COPY,MOVE,LOCK,UNLOCK,TRACE,PATCH
>     Accept-Patch: application/sparql-update
>     *Accept-Post: text/turtle,text/n3,text/nt*
>     Vary: Accept,Origin,If-Modified-Since,If-None-Match
>     Link: <http://www.w3.org/ns/ldp#Resource>
>     <http://www.w3.org/ns/ldp#Resource>; rel="type"
>     Link: <http://www.w3.org/ns/ldp#BasicContainer>
>     <http://www.w3.org/ns/ldp#BasicContainer>; rel="type"
>     Link: <?p=1>; rel="first"
>     Link: <?p=1>; rel="last"
>     Link: <http://kingsley.idehen.net/DAV/home/kidehen/RWWTests,meta>
>     <http://kingsley.idehen.net/DAV/home/kidehen/RWWTests,meta>;
>     rel="meta"
>     Link: <http://kingsley.idehen.net/DAV/home/kidehen/RWWTests,acl>
>     <http://kingsley.idehen.net/DAV/home/kidehen/RWWTests,acl>; rel="acl"
>     ETag: "dcf9bac84af14a8ae25353d0cc468b5e"
>     X-SPARQL-default-graph:
>     http://kingsley.idehen.net/DAV/home/kidehen/RWWTests/
>     Content-Length: 1578
>
>
>     Kingsley
>>
>>     On Sun, May 3, 2015 at 3:30 AM, henry.story@bblfish.net
>>     <mailto:henry.story@bblfish.net> <henry.story@bblfish.net
>>     <mailto:henry.story@bblfish.net>> wrote:
>>
>>
>>         > On 3 May 2015, at 12:04, henry.story@bblfish.net
>>         <mailto:henry.story@bblfish.net> wrote:
>>         >
>>         > Hi,
>>         >
>>         >  the result of a POST is currently according to the spec §
>>         5.2.3.1
>>         >
>>         >>      LDP clients should create member resources by
>>         submitting a representation as the entity body of the HTTP
>>         POST to a known LDPC. If the resource was created
>>         successfully, LDP servers must respond with status code 201
>>         (Created) and the Location header set to the new resource’s
>>         URL. Clients shall not expect any representation in the
>>         response entity body on a 201 (Created) response.
>>         >
>>         > I was wondering if it would make sense for the client to
>>         also send back
>>         > all the headers as well, such as
>>         >
>>         > Access-Control-Allow-Origin: *
>>         > Allow: OPTIONS, GET, HEAD, POST, SEARCH, PATCH, PIT
>>         > Accept-Patch: application/sparql-update
>>         > ETag: "1417390950000|Success(922)"
>>         > Last-Modified: Sun, 1 April 2015 23:42:30 GMT
>>         > This would allow the client to immediately know what
>>         further operations it could do on the newly created resource.
>>
>>         It would be good if one could also in the result specify
>>         which mime types were allowed on a GET on the created resource.
>>
>>         Henryt
>>
>>         >
>>         >
>>         >
>>         > Henry
>>         >
>>         > Social Web Architect
>>         > http://bblfish.net/
>>         >
>>
>>         Social Web Architect
>>         http://bblfish.net/
>>
>>
>>
>>
>>
>>     -- 
>>     Rob Sanderson
>>     Information Standards Advocate
>>     Digital Library Systems and Services
>>     Stanford, CA 94305
>
>
>     -- 
>     Regards,
>
>     Kingsley Idehen 
>     Founder & CEO
>     OpenLink Software
>     Company Web:http://www.openlinksw.com
>     Personal Weblog 1:http://kidehen.blogspot.com
>     Personal Weblog 2:http://www.openlinksw.com/blog/~kidehen  <http://www.openlinksw.com/blog/%7Ekidehen>
>     Twitter Profile:https://twitter.com/kidehen
>     Google+ Profile:https://plus.google.com/+KingsleyIdehen/about
>     LinkedIn Profile:http://www.linkedin.com/in/kidehen
>     Personal WebID:http://kingsley.idehen.net/dataspace/person/kidehen#this
>
>
>
>
> -- 
> Rob Sanderson
> Information Standards Advocate
> Digital Library Systems and Services
> Stanford, CA 94305


-- 
Regards,

Kingsley Idehen 
Founder & CEO
OpenLink Software
Company Web: http://www.openlinksw.com
Personal Weblog 1: http://kidehen.blogspot.com
Personal Weblog 2: http://www.openlinksw.com/blog/~kidehen
Twitter Profile: https://twitter.com/kidehen
Google+ Profile: https://plus.google.com/+KingsleyIdehen/about
LinkedIn Profile: http://www.linkedin.com/in/kidehen
Personal WebID: http://kingsley.idehen.net/dataspace/person/kidehen#this

Received on Tuesday, 5 May 2015 16:03:17 UTC