Problem
PodOS/mashlib cannot create new resources because 404 responses don't include the headers that tell rdflib what editing protocols are supported.
When rdflib tries to create a new resource, it first does a GET to check if it exists. If it gets a 404 without Accept-Patch and Accept-Put headers, it doesn't know how to create the resource.
Error from PodOS:
Can't create new resources with PodOS. You may need to add accept-patch header to 404 resources, so that rdflib can figure out how to create it.
Exception in update: Error: Update: Loaded http://localhost:3210/something-new but still can't figure out what editing protocol it supports.
Solution
Add Accept-Patch, Accept-Put, and Allow headers to all 404 responses so clients know what methods are available for creating resources.
Headers added to 404 responses:
Accept-Patch: text/n3, application/sparql-update
Accept-Put: application/ld+json, text/turtle, */*
Allow: GET, HEAD, PUT, PATCH, OPTIONS
Link: <resource.acl>; rel="acl"
- CORS headers
Affected handlers
handleGet - GET requests for non-existent resources
handleHead - HEAD requests for non-existent resources
handleDelete - DELETE requests for non-existent resources
handlePatch - PATCH requests for non-existent resources
Problem
PodOS/mashlib cannot create new resources because 404 responses don't include the headers that tell rdflib what editing protocols are supported.
When rdflib tries to create a new resource, it first does a GET to check if it exists. If it gets a 404 without
Accept-PatchandAccept-Putheaders, it doesn't know how to create the resource.Error from PodOS:
Solution
Add
Accept-Patch,Accept-Put, andAllowheaders to all 404 responses so clients know what methods are available for creating resources.Headers added to 404 responses:
Accept-Patch: text/n3, application/sparql-updateAccept-Put: application/ld+json, text/turtle, */*Allow: GET, HEAD, PUT, PATCH, OPTIONSLink: <resource.acl>; rel="acl"Affected handlers
handleGet- GET requests for non-existent resourceshandleHead- HEAD requests for non-existent resourceshandleDelete- DELETE requests for non-existent resourceshandlePatch- PATCH requests for non-existent resources