You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_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.
The text was updated successfully, but these errors were encountered:
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.
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.
The text was updated successfully, but these errors were encountered: