SIDN / ietf-epp-restful-transport

RESTful transport for EPP
Other
3 stars 4 forks source link

Mapping EPP code to HTTP status codes? #35

Closed mwullink closed 10 months ago

mwullink commented 11 months ago

Are HTTP status codes independent of EPP codes? This means a EPP error can be combined with a HTTP 200

This would result in a clean separation between the 2 protocols.

But this would mean the normal RESTful API design practices are not followed, as the HTTP status codes do not always represent the actual outcome of the EPP command.

Basing the HTTP status code on the EPP result code would mean the api is more REST-like

mwullink commented 11 months ago

The best option i think is to map epp codes to semantically equivalent http codes and the client can then get detailed explaintion in message body. this is in line with http specs

mwullink commented 10 months ago

mapping the epp to http code will cause mixing of codes i guess

maybe we should just use the REPP-eppcode for all responses, so client can check both http and epp code easily

mwullink commented 10 months ago

decided to not map epp to http codes, except maybe for a few exceptions such 404 use the REPP-eppcode for all responses, so client can check both http and epp code easily

mdavids commented 10 months ago

We will go for HTTP Status Code 422 when EPP result code is 2yzz. Even, for example, in the case of 2200 (so no 401 in that case). We will go for 200 when EPP result is in the 1yxx range. So no 201 after a successful create for instance, just 200 and no 204 after, for instance, a delete. Just 200.

In other cases, when there is no EPP result code available, the HTTP engine may pick something appropriate from https://datatracker.ietf.org/doc/html/rfc9110#name-status-codes, for instance a 404 in the case of POST /repp/v666/domains.

mwullink commented 10 months ago

closing this issue