-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can LDP let a client know that it does not support PUT on creation? #262
Comments
Most certainly, the server would respond with a So, the way I understand this issue is that you want to have a way for the server to communicate that it will not support the |
Also, in that case, when you're not allowing the method at all, you would always respond with |
Yes. PUT to create is not so much an action on one resource, as a capability of the server I think, as it covers a whole range of resources, including potentially creating new containers, etc... There are two things:
So you can return a They are different use cases, but both could make use of |
On the first account, we use language like "When a server supports the HTTP But indeed, it is limited what a client can generalize from this, it cannot infer that So, the |
Besides the error codes, there is nothing that would particularly suggest that PUT-to-create is not supported but PUT-to-modify is supported. Or extreme: only PUT-to-create-RDF-on-Mondays is supported... surely, there is no end to this. Server can only respond to the request with the error and perhaps provide a reason in the message body. Alternatively, we need to come up with a matrix of constraints for HTTP request methods and response error codes or operations. So then the target of constrainedBy can be something like By the way, re constrainedBy matters, there is a PR for it #185 - sort of on hold for reasons.. Neither Not sure if the use case is strong enough to bother with these requirements. Not the simplest problem to solve first. |
btw this came up on the solid test-suite channel on Tue, May 11 2021. The tests were using PUT to create resources and since my server does not support it, @michielbdejong was thinking of first checking the OPTIONS headers to see if the server supported that. But it looks like that won't work until we have |
With #185 , constraint discovery is now described in a non-normative section: https://solidproject.org/ED/protocol#constraints-problem-details . Essentially when a server wants to indicate its own specific constraints, i.e., beyond those defined by a spec, it can simply have a resource describing it. Even with the availability of the constraint information, we don't yet have a data model that would help a client to know that a constraint is actually server-wide, as opposed to resource-specific, so that it no longer makes requests to create resources with a particular method. Ditto using structured error messages in RDF: #28 Essentially This is advanced client behaviour and I'm not entirely sure how worthwhile it is - need more implementation experience. I love it but lets be pragmatic about what's sought for by implementers. My application for instance would try a method with a media type that the server accepts, and if that's not supported, it will try the next allowed method. I think that already does more than the average application. If you make your server advertise put-to-create constraint server-wide, I'll implement it on my end for fun and profit ;) For now: respond with 405, omit PUT in Allow, omit Accept-Put, and if you're up to it, include Link header with ldp:constrainedBy targeting http://example.org/constraints#put-to-create Closing this issue with the understanding that it can be revisited in the future if need be - perhaps towards documenting "matrix of constraints for HTTP request methods and response error codes or operations". For the time being, the suggestion for servers is to stick to resource-specific messaging, consider advertising their own specific constraints, and explore structured error messages. |
I have not yet implemented PUT to create resources on my Solid server, in part because my server has restrictions on the type of URLs that could be used for a PUT and there is no way to express that to the client. (see comment on issue 44: the server does not allow
.
in paths, because it uses those for metadata and content negotiation on the file system.)IT would be useful to be able to express that PUT to create is not allowed by a server, but I can't see that this is possible in LDP as PUT on a container (especially indirect containers) is it seems acceptable... So that PUT would appear in the
Allow:
header on a Container there, but would not mean that one can use PUT to create resources.Is this another user case for a
Link
constrainedBy ontology?The text was updated successfully, but these errors were encountered: