Skip to content
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

StatusCode is not clear about the 404 status code #279

Open
tomkuijsten opened this issue Oct 6, 2020 · 1 comment
Open

StatusCode is not clear about the 404 status code #279

tomkuijsten opened this issue Oct 6, 2020 · 1 comment

Comments

@tomkuijsten
Copy link
Contributor

tomkuijsten commented Oct 6, 2020

If I read the follow part of the statuscode doc:

_If a request is syntactically valid JSON and addresses an existing resource, a HTTP error MUST NOT be returned. Those requests are supposed to have reached the OCPI layer.

In case of a GET request, when the resource does NOT exist, the server SHOULD return a HTTP 404 - Not Found._

It's kinda unclear now what to do when I receive a PUT with syntactically valid JSON on an unexisting resource. I would say, 404. But it's confusing that you are explicitly saying that a GET request should give a 404. Gives you the idea that the GET should respond different then other verbs.

@RobertDeLeeuw
Copy link

I would prefer a PUT to create a new resource on the server in case the resource does not yet exist. Otherwise the client needs to read the response, figure out that the POST was missed and send the same request again, this time as a POST.

I don't see the advantage of sending a 404 on an PUT of an unknown resource. But I might be missing something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants