Closed rocky closed 5 years ago
Regarding the first point:
In REST API HTTP status tells about the result of this very request. In your case, GET https://api.mythril.ai/v1/analyses/a1aaa0c9-6241-4956-aac8-a0acd4617156 - get information about analysis a1aaa0c9-6241-4956-aac8-a0acd4617156, which you got successfully, thus 200 OK. Sure, the status of the analysis itself is given by status
field in the response.
HTTP 201 status is intended for things like creation of new users, etc.; but it is only useful when there is an endpoint that can create a new resource in some cases, and to not create it in other (and both are valid behaviors), thus using 201 for the first case and other status for the second allows to distinguish them. We, probably, can use 200 and 202 HTTP status to distinguish scenarious when analysis is queued, and when the result is taken from the cache right away, that might be conveninient for the client.
Regarding the error, I hopefully check this week. To clean-up error messaging is on my todo list already (#12)
Resolved.
200 OK
? Wouldn't 201 or something different be better?Continuing...
Analysis is not finished? (Note that should either be in quotes, or better a lowercase "finished"). But status says it errored, so it is finished.