3

I am not sure what status code should I return to client. When the request has parameters out of range. My API support paging from page 1 to (let's say) 50. Which status code should server return to

page < 1 || page > 50

1 Answer 1

6

See http codes and explanation for example here: http://en.wikipedia.org/wiki/List_of_HTTP_status_codes

You should use some of the 4xx codes, because it's error on client side.

Let's use the 400 (Bad Request) status code. It's general error code, so it should be right.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.