gcivil-nyu-org / spring2020-cs-gy-9223-class

2 stars 14 forks source link

Handle 415 status in Measurement API #644

Closed jackxujh closed 4 years ago

jackxujh commented 4 years ago

User story The API will reject requests that have Content Type other than application/json. It returns a 415 status code. But this is an unknown behavior from the code, and it is not mentioned in the instruction as a requirement to use the API. It can be puzzling for users.

Acceptance criteria

Definition of Done The 415 status code to return to the user agent is now a known behavior.

Ziheng-Wang commented 4 years ago

https://httpstatuses.com/415

alldne commented 4 years ago

Changes on the api documentation would be enough?

jackxujh commented 4 years ago

@alldne i think it would be enough for the user. But still, the code we have does not suggest we are limiting the POST request to application/json. I hope this user story can have a little digging and reveal why the limitation is added.

jackxujh commented 4 years ago

The measurement API always surprises us every week during rehearsal. I would say, it is either the user does not get the idea of this API, or the API has not been designed to be easy to work with. But either case, we want to make the life easier for the user as best as we can.