I'm hitting some behavior that surprises me, though again am unsure if it's a corner of LDP I'm less familiar with.
HTTP/1.1 201 Created
Date: Wed, 08 May 2019 20:50:16 GMT
Content-Length: 0
That worked as expected. I issue a GET request to the new resource URI:
HTTP/1.1 200 OK
Date: Wed, 08 May 2019 21:20:17 GMT
Last-Modified: Wed, 08 May 2019 20:50:16 GMT
Vary: Accept
Vary: Accept-Datetime
Vary: Range
Vary: Want-Digest
Content-Type: application/json
Accept-Ranges: bytes
ETag: "30ad7e8bda5dccf3ac6ac930d9aac328"
Allow: GET,HEAD,OPTIONS,PUT,DELETE
Cache-Control: no-transform, must-revalidate, max-age=86400
Vary: Accept-Encoding
Content-Length: 48
{ "foo": "bar", "baz": { "quuux": "whatever" } }
The content looks exactly right and the Link headers return the types I expect. Here's where it gets weird. I issue the GET again, but this time I add the 'Accept: application/ld+json' header:
HTTP/1.1 200 OK
Date: Wed, 08 May 2019 21:20:57 GMT
Last-Modified: Wed, 08 May 2019 20:50:16 GMT
Vary: Accept
Vary: Prefer
Vary: Accept-Datetime
Content-Type: application/ld+json
Accept-Patch: application/sparql-update
ETag: W/"719b7e15123d6450c13c466289d6f27f"
Allow: GET,HEAD,OPTIONS,PATCH,PUT,DELETE,POST
Cache-Control: no-transform, must-revalidate, max-age=86400
Vary: Accept-Encoding
Content-Length: 626
{"@context":{"schema":"
http://schema.org/","owl":"
http://www.w3.org/2002/07/owl#","xsd":"
http://www.w3.org/2001/XMLSchema#","skos":"
http://www.w3.org/2004/02/skos/core#","memento":"
http://mementoweb.org/ns#","rdfs":"
http://www.w3.org/2000/01/rdf-schema#","acl":"
http://www.w3.org/ns/auth/acl#","geo":"
http://www.w3.org/2003/01/geo/wgs84_pos#","dc11":"
http://purl.org/dc/elements/1.1/","as":"
https://www.w3.org/ns/activitystreams#","rdf":"
http://www.w3.org/1999/02/22-rdf-syntax-ns#","ldp":"
http://www.w3.org/ns/ldp#","time":"
http://www.w3.org/2006/time#","prov":"
http://www.w3.org/ns/prov#","dc":"
http://purl.org/dc/terms/"}}
1. What is this that is returned? It's an empty context object. Where's it coming from?
2. Related: why did adding an Accept header to the GET request change the Link headers in the response?