We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
currently plone.rest returns a 404 for a request to the following service
<plone:service method="GET" accept="application/json" for="Products.CMFPlone.interfaces.IPloneSiteRoot" factory=".rest.MyService" name="@servicename" permission="zope2.View" />
when the request is made with https://httpie.org/ like this
http --json GET https://server.com/@servicename HTTP/1.1 404 Not Found ...
https://github.com/plone/plone.rest/blob/1.6.0/src/plone/rest/negotiation.py#L27 also documented in the docstring:
Only Accept headers containing exactly one media type are considered for negotiation.
and httpie sends two media types in the accept header "Accept": "application/json, */*",
"Accept": "application/json, */*",
http --debug --json GET https://server.com/@servicename HTTPie 0.9.8 ... >>> requests.request(**{ "allow_redirects": false, "auth": "None", "cert": "None", "data": "", "files": {}, "headers": { "Accept": "application/json, */*", "Content-Type": "application/json", "User-Agent": "HTTPie/0.9.8" }, "method": "get", "params": {}, "proxies": {}, "stream": true, "timeout": 30, "url": "https://server.com/@servicename", "verify": true })
use first media type mentioned in accept header (if multiple are given)
[or even return the service if one of the accept types matches.]
The text was updated successfully, but these errors were encountered:
@buchi as you seem to have written the docstring (d587089): may i ask you to elaborate why this decision has been made? thank you!
Sorry, something went wrong.
@frisi : see answer in #62 where I've asked the same question.
No branches or pull requests
Current state:
currently plone.rest returns a 404 for a request to the following service
when the request is made with https://httpie.org/ like this
Reason:
https://github.com/plone/plone.rest/blob/1.6.0/src/plone/rest/negotiation.py#L27
also documented in the docstring:
and httpie sends two media types in the accept header
"Accept": "application/json, */*",
Possible solution
use first media type mentioned in accept header (if multiple are given)
[or even return the service if one of the accept types matches.]
The text was updated successfully, but these errors were encountered: